Made in Builder

Made in Builder

Webinar ๐Ÿ‘‰ Visually Build at Scale with Builder.io & Netlify on 12/1

ร—

Developers

Product

Use Cases

Pricing

Developers

Resources

Company

Get StartedLogin

โ˜ฐ

Product

Features

Integrations

Talk to an Expert

Pricing

Blog

Home

Resources

Blog

Forum

Github

Login

Signup

ร—

Visual CMS

Drag-and-drop visual editor and headless CMS for any tech stack

Theme Studio for Shopify

Build and optimize your Shopify-hosted storefront, no coding required

Resources

Blog

Get StartedLogin

โ˜ฐ

Querying Cheatsheet

This document is a quick reference for query operators you can use to query anything that's on your content objects.

To experiment with querying your content from within Builder, you can use the Builder API Explorer.

Table of contents

This document covers the following operators:

Comparison Operators

$eq

$gt

$gte

$in

$lt

$lte

$ne

$nin

Logical Operators

$and

$not

$or

$nor

Element Operators

$exists

$type

Array Operators

$elemMatch

Evaluation Operators

$regex

$options

MongoDB style queries for your Builder data

When querying Builder data, you can use MongoDB style operators, such as:

OperatorDescription

$eq

Use to match values equal to a specified value.

$gt

Use to match values greater than a specified value.

$gte

Use to match values greater than or equal to a specified value.

$in

Use to match any of the values you specify in an array.

$lt

Use to match values less than a specified value.

$lte

Use to match values that are less than or equal to a specified value.

$ne

Use to match all values not equal to a specified value.

$nin

Use to match none of the values specified in an array. This example excludes the numbers 50 and 51.

$and

Use to join query clauses with a logical and and return all documents that match the conditions of both clauses.

$not

Use to invert the effect of a query expression and return documents that do not match the query expression.

$or

Use to join query clauses with a logical or and return all documents that match the conditions of either clause.

$nor

Use to join query clauses with a logical nor and return all documents that do not match both clauses.

$exists

Use to match documents that have the specified field.

$type

Use to select documents if a field is of the specified type.

$elemMatch

Use to select documents if element in the array field matches all the specified $elemMatch conditions.

$regex

Use to select documents where values match a specified regular expression.

$options

Use to specify options to use with $regex.

For more detail about available options, refer to the MongoDB $regex documentation.

Descriptions for the above operators adapted from MongoDB per the Creative Commons License as referenced on the MongoDB Documentation GitHub repo. For more in-depth information on the query operators above, see MongoDB's documentation on Query and Projection Operators.

Next Steps

For more information on querying, see the Content API documentation.


Need Expert help?

Reach out to us, and we will match you with a Builder expert.

Connect with us

Was this article helpful?