website logo
⌘K
πŸ–οΈIntroduction to hyper cloud
🍎Getting Started
😍What's New
Blueberry Migration Guide
πŸ’ͺWorkshops
Deno Workshops
NodeJS Workshops
⚑Quickstarts
NodeJS Quickstarts
πŸ”ŒAPI Reference (hyper cloud)
🍎Basics
⚑hyper connect
πŸ”‘JWT Auth
πŸ’ΎData API
🏎️Cache API
πŸ”ŽSearch API
πŸ—„οΈStorage API
πŸ€“Queue API
πŸ”“Sign In
⚑Applications
βš™οΈSettings
πŸ”‘App Keys
πŸ‘₯Teams
Switching Between Accounts
Application Services
Application Service Instances
Adding a Queue Service
Adding a Search Service
Subscriptions
πŸ€‘Upgrade
πŸ“•Terminology
Parameters
πŸ’³Billing
Payment and Pricing Terms
πŸ’ΌLegal
Terms of Service
Acceptable Use Policy
Privacy Policy
πŸ•ΆοΈHyper Vision
Docs powered byΒ archbeeΒ 
5min

Query Selectors

When creating queries in the hyper cloud you need to build your query filter using a special syntax called a selector. The selector is a JSON structure that allows you to create logic patterns to inform the service how to appropriately return the correct documents.

Selectors

Selector

Description

Example *

$eq

Equals, match when property equals this value

{ "title": { "$eq": "Ghostbusters"}}

$ne

The property does not equal the value

{ "title": {"$ne": "Groundhog Day"}}

$lt

The property value is less than the value

{ "year": {"$lt": "1990"}}

$lte

The property value is less than or equal to the value

{ "year": { "$lte": "1990"}}

$gte

The property value is greater than or equal to the value

{ "year": {"$gte": "2000"}}

$gt

The property value is greater than

{ "year": {"gt": "2000"}}

$exists

Check whether the property exists

{ "type": {"$exists": true}}

$type

Check the properites type, valid values are "null", "boolean", "number", "string", "array", "object"

{ "title": {"$type": "string"}}

$in

The document property must exist in the list of values provided.

{ "title": {"$in": ["Star Wars", "Star Trek"]}}

$nin

The document property must not exist in the list of values provided.

{ "title": {"$nin": ["Superman", "Spiderman"]}}

$mod

The document property value modulus a divisor that equals a remainder. eg [Divisor, Remainer]

{ "total": {"$mod": [2, 0]}} // even numbers

$regex

The document property must be a string and the regex expression matches all documents that match the regex

{ "title": {"$regex": "^Star" }}

In the examples above, the JSON Document represents a "KEY" : "VALUE" Pair where the "title" string is a property on the JSON Document.

Selector Operators

By default, every selector in the root branch of the selector object must be true, which results in an and operation. Sometimes you may want an or operation, in that case, you need to wrap your selectors in an $or property.

JSON
|

You can also use the $and selector if you have to combine both.

Need Help?

You can always reach out to our support team for any additional assistance on slack.

Updated 24 Mar 2022
Did this page help you?
Yes
No
UP NEXT
Cache API
Docs powered byΒ archbeeΒ 
TABLE OF CONTENTS
Selectors
Selector Operators
Need Help?