Skip to main content
Indexes are a crucial part of database performance optimization. Orionjs provides a clean, declarative way to define and manage MongoDB indexes.

Defining Indexes

Indexes are defined as part of the collection configuration:

Index Types

Single Field Index

Compound Index

Unique Index

TTL Index (Time-To-Live)

Text Index

Geospatial Index

Index Options

The options object can include the following properties:

Partial Indexes

Partial indexes only index documents that meet a specified filter expression: