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
  1. Core Features
  2. Queries
  3. Advanced Operators

.name

Specifies an Object by Name

When a type references another type, it is not possible to directly query that object. The .name operator enables support for such an operation. It is similar to a JOIN operation in SQL. This is used to reference other types which have their own name field and are first-class database objects.

Example: User and Profile

Given the following example of a User and a Profile:

The User object has fields such as name, and ID.

{
  "id" : "abcd",
  "name" : "earl1",
  "email" : "earl1@example.com"
}
{
  "id" : "defg",
  "displayName" : "Earl 1",
  "user" : {
    "id" : "abcd",
    "name" : "earl1",
    "email" : "earl1@example.com"
  }
  "application" : { 
    "id" : "hijk",
    "name" : "EXAMPLE"
  }
}

It would, at a glance, make sense to attempt to query a Profile this way:

user.name:earl1

However, as User is a reference that will return no results. Therefore it is necessary to use the reference operator to perform the query:

.name.user:earl1

This tells the query engine to execute the following:

  • Identify the client is requesting a reference to another object.

  • Identify the reference as the user field.

  • Find a user with name = "earl1"

  • Find all Profiles matching that user.

Previous.refNextCustom Code