JSON/q

A JSON-based data access specification

Queries on stores have no defined order (unlike queries on arrays), but $index will be available anyway. The engine may not return results in the same order on subsequent queries, so $index should not be depended on for program logic.

Query

{
  "as": [
    "c", 
    "o"
  ], 
  "from": [
    "Customers", 
    "c.orders"
  ], 
  "select": [
    "c.$index", 
    "o.orderId"
  ]
}

Results

{}