Website logo
⌘K
🖐️Introduction to hyper cloud
🍎Getting Started
😍What's New
Legacy Get Migration Guide
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
API Reference (hyper cloud)
Data API

Query Selectors

3min

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
{ 
  "$or": { 
    "title": "Ghostbusters",
    "title": "Groundhog Day"
  }
}


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 03 Mar 2023
Did this page help you?
PREVIOUS
Bulk Documents
NEXT
Cache API
Docs powered by Archbee
TABLE OF CONTENTS
Selectors
Selector Operators
Need Help?
Docs powered by Archbee