Elements Manual
Elements 3 Manual
Elements 3 Manual
  • Welcome 👋
  • QUICK START
    • Elements in Five Minutes or Less
    • Accessing the Web UI (CRM)
    • Creating A User
  • General
    • General Concepts
    • N-Tier Architecture
    • Security Model
  • Core Features
    • Core API Overview
    • Sessions
    • Applications
    • Users and Profiles
    • Digital Goods
    • Progress and Missions
    • Leaderboards
    • Matchmaking
    • Followers
    • Friends
    • Reward Issuance
    • Save Data
    • Schemas and Metadata Specifications
    • Queries
      • Base Query Syntax
      • Boolean Queries
      • Object Graph Navigation
      • Advanced Operators
        • .ref
        • .name
    • Custom Code
      • Element Structure
      • RESTful APIs
      • Websockets
    • Auth Schemes
      • OIDC
      • OAuth2
  • Web 3
    • Omni Chain Support
    • Vaults
    • Wallets
    • Smart Contracts
      • Smart Contracts: Ethereum
      • Smart Contracts: Flow
      • Smart Contracts: Solana
      • Smart Contracts: Neo
  • CONFIGURATION
    • Direct Database Access and Batch Configuration
    • Batch Samples
      • Item Upload Bash Script Sample
      • Mission Upload Bash Script Sample
  • RESTful APIs
    • Swagger and Swagger UI
    • API Specification
      • /application
      • /application/configuration
      • /auth
      • /auth_scheme
        • /custom
        • /oauth2
        • /oidc
      • /blockchain
      • /followee
      • /follower
      • /friend
      • /google
      • /index
      • /inventory
      • /item
      • /large_object
      • /leaderboard
      • /rank
      • /score
      • /match
      • /mission
      • /progress
      • /reward_issuance
      • /schedule
      • /notification
      • /profile
      • /save_data
      • /metadata_spec
      • /mock_session
      • /session
      • /health
      • /version
      • /signup
      • /user
    • Javadocs
  • Releases
    • 3.1 Release Notes
Powered by GitBook
On this page
  • Example: Finding Legendary Swords
  • Example: Finding Legendary Low-Level Swords
  1. Core Features
  2. Queries

Boolean Queries

Combining Base Queries to Form Complex Queries

In addition to Base Query Syntax, it is possible to mix and match multiple queries to perform complex lookups of objects in the database. The following operators allow for greater complexity of finding objects within Elements:

  • AND - Logical all-inclusive operation. Both sides of the AND operation must be true for the object to match.

  • OR - Logical operation which will match if the object matches either the left or right side of the operator

  • NOT - Logical negation. The operator following NOT must be false to match the object in the query.

  • ( ) - Grouping Operator. Groups operations such that they are evaluated before the groups on the outside. Used to force order of operations or provide clarity where the syntax may be ambiguous.

Example: Finding Legendary Swords

With complex Boolean queries, it is possible to perform advanced grouping of data. For example, it may be possible to search for all distinct items with certain metadata fields.

In this case, we can query the whole database for legendary swords:

metadata.type:Sword AND metadata.rarity:Legendary

This will match all objects which match the following criteria:

  • Have a metadata string property named "Type"

  • Have a metadata string property named "Rarity"

  • Type equals the word "Sword"

  • Rarity equals the word, "Legendary"

Example: Finding Legendary Low-Level Swords

We can further refine the query to include stats on the item itself:

metadata.type:Sword AND metadata.rarity:Legendary AND metadata.level:10 TO 20

This will match all objects which match the following criteria:

  • Have a metadata string property named "Type"

  • Have a metadata string property named "Rarity"

  • Type equals the word "Sword"

  • Rarity equals the word, "Legendary"

  • The object's level is between Level 10 and Level 20.

PreviousBase Query SyntaxNextObject Graph Navigation