Back to gallery

Indexes

Create and list secondary indexes at runtime.

Live
DB.createIndex / listIndexes

Create index

Field Direction

What an index does

An index is a sorted lookup structure the engine maintains alongside the collection. A query filtering or sorting on category can jump straight to the matching rows instead of scanning every document — turning an O(n) scan into an O(log n) seek. unique additionally rejects duplicate values.
Index ops

No output yet — run the demo above.

Indexes on demo_products

7
idx_kitchensinklabertasch_demo_products_auto_name document
name: 1
idx_kitchensinklabertasch_demo_products_auto_price document
price: 1
idx_kitchensinklabertasch_demo_products_auto_stock document
stock: 1
idx_kitchensinklabertasch_demo_products_category document
category: 1
idx_kitchensinklabertasch_demo_products_category_desc document
category: -1
idx_kitchensinklabertasch_demo_products_category_price document
category: 1, price: 1
idx_kitchensinklabertasch_demo_products_sku_uniq unique document
sku: 1
Maravilla

A live kitchen-sink tour of every Maravilla cloud capability. Each mini-app runs against the local dev platform.

Built on Maravilla Cloud