Elements Manual
Elements 2 Manual
Elements 2 Manual
  • Welcome 👋
  • QUICK START
    • Elements in Five Minutes or Less
  • General
    • General Concepts
    • N-Tier Architecture
    • Security Model
  • SCRIPTING ENGINE
    • Scripting Engine Overview
      • Intro to Resources and Cloud Functions
      • Horizontal Scaling Model
      • Database Access
      • Server-to-Server API Calls
      • Deploy Cloud Functions via Git
      • Creating and Destroying Resources
      • Cross-Resource Invocation
      • Indexing Resources
      • Coroutines
      • Manifest
  • Core Features
    • Core API Overview
    • Sessions
    • Applications
      • Facebook Application Configuration
      • Firebase Application Configuration
      • Amazon GameOn Application Configuration
      • iOS Application Configuration
      • Android Application Configuration
      • Matchmaking Application Configuration [deprecated]
    • Users and Profiles
    • Digital Goods
    • Progress and Missions
    • Leaderboards
    • Matchmaking
    • Followers
    • Friends
    • Reward Issuance
    • Push Notifications
    • Auth Schemes
    • Save Data
    • Schemas and Metadata Specifications
    • Queries
      • Base Query Syntax
      • Boolean Queries
      • Object Graph Navigation
      • Advanced Operators
        • .ref
        • .name
  • Web 3
    • Omni Chain Support
    • Vaults
    • Wallets
    • Smart Contracts
      • Smart Contracts: Ethereum
      • Smart Contracts: Flow
      • Smart Contracts: Solana
      • Smart Contracts: Neo
    • Know Your Customer
      • Formidium
  • CONFIGURATION
    • Using the Web Console
    • iOS and Android Product Bundles
    • Direct Database Access and Batch Configuration
  • UNITY PLUG-INS
    • Unity Plugin
    • Content Delivery Management and Unity CDN Plugin
  • DEPLOYMENT
    • Deployment Overview
      • Docker Containers
      • AWS Deployment
      • Standalone docker-compose
  • LUA SAMPLES
    • lua Samples
      • main.lua
      • event.lua
      • hello_world.lua
      • model.lua
      • startup.lua
      • HTTP Manifest
        • Example endpoint handler
        • Example operations table
  • RESTful APIs
    • Swagger and Swagger UI
    • Elements 3.0.X (Preview)
      • Applications
      • Friends and Followers
      • Digital Goods and Inventory
      • Leaderboards
      • Missions and Rewards
      • User and Profiles
      • Save Data
      • Custom Metadata
Powered by GitBook
On this page
  • Text Queries
  • Numeric Queries
  • Range Query
  1. Core Features
  2. Queries

Base Query Syntax

Base Query Syntax

The query system support two major types, Strings and Numbers. When searching for objects, it will be necessary to distinguish between those two types.

Text Queries

When dealing with text types, the : operator is used for textual equality. The full syntax is as follows:

{property name}:{property value}

This will perform a query which matches objects with the following criteria:

  • property name must exist on the object

  • The value of the object in the database must be a string

  • The value must match exactly property value

If those conditions are not met, then no objects will match.

Additionally, it is possible to encapsulate the property in quotes to ensure that the parser will properly parse the values. For example:

displayName:"Jack Ryan 1984"

Will match exactly the string "Jack Ryan 1984"

Numeric Queries

Similar text queries, numeric queries exist allowing for complex selection of numeric values. Unlike text queries, Elements supports multiple operators:

  • < - Less Than

  • > - Greater Than

  • <= - Less Than or Equal To

  • >= - Greater Than or Equal To

  • = - Equal to

  • != - Not Equal or Logical Xor

  • : and TO - Range Operator

Numeric queries typically look a little bit different than their string-based counterparts and, with the exception of the range operator, follow the following syntax:

{property name} {numeric operator} {property value}

This will perform a query which matches objects with the following criteria:

  • property name must exist on the object

  • The numeric operator must be a valid operator one of:

    • <, >, <=, >=, =, !=

    • For range queries, see the section Range Query for more information.

  • The value must match property value based on the rules of the operator

For example, it would be possible to find all scores greater than 100 using the following query:

score > 100

Range Query

The Range Query is a special case designed to reduce the need to define ranges using a combination of boolean operators. Range Queries look similar to String queries, with the important distinction that they are able to operate ranges of numbers. All ranges are inclusive and use the following syntax:

{property name}:{property lower bound} TO {property upper bound}

This will perform a query which matches objects with the following criteria:

  • property name must exist on the object

  • The value of the object in the database must be a number

  • The value must be ...

    • Greater than or equal to property lower bound

    • Less than or equal to property upper bound

PreviousQueriesNextBoolean Queries

Last updated 1 year ago