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

Was this helpful?

Edit on GitHub
  1. API
  2. Database
  3. Taxonomies

Find

Overview of taxonomy find method

Find

GET https://api.codemash.io/:version/db/taxonomies/:taxonomyName/terms

Gets many terms by using a filter. This endpoint accepts GET and POST methods.

Path Parameters

Name
Type
Description

version

string

A version of the API endpoint.

taxonomyName

string

The name of taxonomy to get records from.

Query Parameters

Name
Type
Description

filter

string

Filter document. This allows you to find records by a custom filter. More about filters follow the link below.

cultureCode

string

Language code. If your terms have translatable fields, those fields will only include this specified language. If not provided, will take language from the Accept-Language header.

sort

string

Sort document. This allows you to sort your records. More about sorting follow the link below.

projection

string

Projection document. This allows you to specify what fields to return decreasing the amount of data transferred. This is applied to the Meta field. More about projections follow the link below.

pageSize

integer

Amount of terms to return.

pageNumber

integer

The page to return. More about paging follow the link below.

includeTaxonomy

boolean

Includes taxonomy to the response.

excludeCulture

boolean

Culture code or Accept-Language header will be used for translatable fields. If you want to get values in all languages, set this as true.

Headers

Name
Type
Description

Authorization

string

Secret API key which belongs to your project or user. Not required if using cookies with a session ID.

x-cm-projectid

string

Your project's ID. Can be passed as a query parameter.

{
    "result": [
        {
            "_id" : ObjectId("5e4faae1eda13b4b9c4b5ab9"),
            "createdOn" : ISODate("2020-01-01T12:00:00.000Z"),
            "modifiedOn" : ISODate("2020-01-01T12:00:00.000Z"),
            "taxonomyId" : ObjectId("5e4faaa5eda13b4b9c4b5ab8"),
            "taxonomyName" : "countries",
            "name" : {
                "en" : "Eswatini",
            },
            "description" : {
                "en" : "Country in Africa",
            },
            "order" : 1,
            "parentId" : ObjectId("5e4faae1eda13b4b9c4b5ab2"),
            "dependencies" : {
                "5e4faae1eda13b4b9c4b5ab2": [
                    ObjectId("5e4faae1eda13b4b9c4b5ab3"),
                    ObjectId("5e4faae1eda13b4b9c4b5ab4"),
                ]
            },
            "meta" : "{ \"text\" : \"Meta_Text\" }"
        }
    ],
    "totalCount": 1,
    "taxonomy": null,
}
var client = new CodeMashClient(apiKey, projectId);
var service = new CodeMashRepository<Person>(client);

var persons = await service.FindAsync(
    x => true,
    new DatabaseFindOptions()
);

Check the docs about entities on how the response records are deserialized into your class objects.

import { db } from 'codemash';

export async function getCountries() {
    return await db.getTaxonomyTerms('countries');
}

export async function getCities() {
    return await db.getTaxonomyTerms('cities');
}
PreviousTaxonomiesNextFiles

Last updated 4 years ago

Was this helpful?

Check the docs on how to form , , , . Check the docs on how to use .

projections
filters
sorting
paging
references