Skip to content

[FEATURE] add slug to plant documents #26

Open

Description

@vinjatovix

Problem

it's easier to make an url with a scientific name based slug

Proposed solution

add slug field to plant document. this could be made from the scientific name. i.e.

db.plants.updateMany(
  { slug: { $exists: false } },
  [
    {
      $set: {
        slug: {
          $replaceAll: {
            input: {
              $toLower: "$identity.scientificName"
            },
            find: " ",
            replacement: "-"
          }
        }
      }
    }
  ]
)

Example (API)

GET /plants/:slug
GET /plants/allium-cepa

Impact

  • Domain
  • Application (use cases)
  • API (controllers/routes)
  • Infrastructure

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions