CodeMash
  • 🚀Backend as a service
  • 🦄Roadmap
  • 🍕Release Notes
  • Installation
    • Managed Service
    • 🏗️AWS-CDK
    • 🏗️Azure
    • 🏗️Docker
    • 🏗️GC
    • 🏗️Terraform
  • dashboard
    • CodeMash Cloud
    • Project
    • Membership
      • Users
      • Roles
      • Policies
      • Triggers
      • Integrations
        • Apple
        • Azure
        • Facebook
        • Google
        • Twitter
      • Settings
    • Database
      • Collections
        • Schema
          • From Template
          • Structure
        • Tabs
        • Triggers
        • Indexes
        • Shared Forms
      • Taxonomies
        • Terms
        • Schema
        • Settings
      • Aggregation
      • Imports
      • Exports
      • Backups
    • Files
      • Integrations
        • CodeMash
        • S3 Bucket
    • Notifications
      • Push
        • Push Templates
        • Push Templates API
        • Push Notifications
        • Push Notifications API
        • Devices
        • Devices API
        • Integrations
          • Firebase
          • One Signal
          • Expo
      • Email
        • Email Templates
        • Emails
        • Integrations
          • AWS SES
          • Twilio Sendgrid
          • Mailgun
      • 🏗️Server events
      • 🏗️Sms
    • Payments
      • Integrations
        • Apple Pay
        • Google Pay
        • Stripe
        • Kevin.
        • Paysera
        • Decta
    • Scheduler
    • Logs & Monitoring
    • Code
      • Functions
        • Function Inputs
        • Function Templates
          • Node.js
          • Python
          • Ruby
          • Java
          • Go
          • .NET Core
      • CodeMash Functions
        • Google Functions
          • Google Calendar
          • Google Gmail
        • Microsoft Functions
          • Microsoft 365 Users
          • Microsoft 365 Calendar
        • Collection Find
        • Collection Update
        • Users Find
        • Image Resize
        • Html To Pdf
        • Word Document
        • Barcode
        • QR Code
        • Send Email
        • Send Notification
        • Email Reminder
        • Notification Reminder
      • Integrations
        • AWS Lambda
        • Google Cloud Functions
        • Azure Functions
  • Other Topics
    • Apple
      • Developer Portal
      • Bundle Identifier
      • Team ID
      • Service ID
      • Key ID
    • Triggers
    • Tokens Binding
      • Project Tokens
      • Initiator Tokens
      • Receiver Tokens
      • Request Tokens
      • Operation based tokens
      • Template Functions
    • Search parameters
      • Paging
      • Filter
      • Sort
      • Projection
    • data-models
    • Errors
  • SDK
    • Node.js
    • TypeScript
    • .NET
    • 🏗️Go Lang
    • 🏗️Flutter
    • 🏗️Swift
    • 🏗️Kotlin
  • CLI
    • 🏗️CodeMash CLI
  • API
    • Get Started
    • Prerequisites
    • How to test?
    • Cors
    • Project
    • Membership
      • Authentication
      • Users
    • Database
      • Collections
        • Aggregate
        • Change Responsibility
        • Count
        • Delete
        • Delete Many
        • Distinct
        • Find
        • Find One
        • Insert
        • Insert Many
        • References
        • Replace
        • Update
        • Update Many
      • Taxonomies
        • Find
    • Files
    • Code
    • Notifications
      • Push
      • Emails
      • Server Events
      • 🏗️Sms
    • Payments
    • Scheduler
    • Logs & Monitoring
Powered by GitBook
On this page
  • Use the Taxonomy rule of thumb
  • When not to use Taxonomy
  • Creating taxonomies
  • 1:N relationship
  • Extending Taxonomy schema
  • Terms
  • API reference

Was this helpful?

Edit on GitHub
  1. dashboard
  2. Database

Taxonomies

Simple data structure with many names like dictionaries, loops, classifications, types,... - you name it.

PreviousShared FormsNextTerms

Last updated 2 years ago

Was this helpful?

In CodeMash, Taxonomy is a type of collection where you store simple structural data; usually, you refer to that data in (a.k.a tables). When you want to classify and group simple structure data, it would be best to choose taxonomy.

Good examples of taxonomy would be:

  • Countries

  • Cities

  • Order Statuses (Pending, In Progress, Paid, Completed, ...)

  • Event Types (Course, Webinar, Conference, ...)

  • Work Item Types (Polishing, Service, Replacement of parts, Assembling, Dissasembling, ...)

Use the Taxonomy rule of thumb

Selected list items below are the perfect match to make data as a taxonomy:

if you are unsure if it will be changed later by some company policy change (the company can decide to have a new type called "Contractor"), it might be better to stick with taxonomy instead of having this as a database enum field.

When not to use Taxonomy

Please consider if it makes sense to have your data as taxonomy when:

  1. The data list is short and with well-known and finished scope. E.g., Imperial units of measurement is a perfect match for the Enum database field rather than Taxonomy

    • Foot (feet)

    • Inches (inch)

    • Mile

    • Yard

  2. Data is complex, with many additional fields. Taxonomy doesn't support all the fields the database collection schema does. You can extend taxonomy with custom fields, but those fields are stored under _meta property, so querying data is a bit more complicated.

Creating taxonomies

You can see and create a new taxonomy on our dashboard page:

  • Go to Database

  • Choose Taxonomies

  • Here you can see all your project taxonomies, and you can create a new one by pressing the "Add New" button

1:N relationship

Let's say you want a country's list of corresponding states and cities. Such structure is explained below:

So we have three taxonomies here - Countries, States, and Cities. The parent of the taxonomy States is taxonomy Countries, and the parent of the taxonomy Cities is, of course, States' taxonomy. Le's follow the instructions defined below to achieve such functionality:

  1. Add new taxonomy (Database -> Taxonomies -> Add New) called "Countries."

  2. Add new taxonomy called "States."

  3. Add new taxonomy called "Cities."

  4. Go to States' taxonomy and press the taxonomy settings page.

    1. From the list of all taxonomies...

    2. ....or from the Taxonomy terms page

  5. Point the parent property of the taxonomy of States to the taxonomy of Countries.

  6. Point the parent property of the taxonomy of Cities to the taxonomy of States. The same as you did in the 5th step.

  7. Fill in Countries. Go to Database -> Taxonomies -> Countries and add countries.

  8. Fill in states. Now for each state, you can refer country accordingly.

  9. Repeat it with cities.

Congratulations. Mission accomplished.

Now you can fetch such structure in any of your projects.

  • You can get all the hierarchical data in a one bunch

  • You can get those cities, countries, and states translated into your language. Terms localization

  • You can expand your taxonomy schema and add more relevant data to your project, e.g., country flag and VAT percentage for goods...

Extending Taxonomy schema

Terms

Taxonomy records are called terms.

API reference

Get Terms

Sometimes having an id and value data type is not enough. You often want to extend it a bit, add one extra digital number representing the country's population, or add some flag of the country that you can fetch from your mobile app. Are you forced for such a change to use rather than taxonomy? Well, if the extension is simple, we have you covered. Please follow to see capabilities.

database collections
collections
Collection
this page