Skip to main content
LambdaDB allows you to add one or more sorts on specific fields. Each sort can be reversed as well. The sort is defined on a per field level.
Sorting can be done on the following data types:
  • long
  • double
  • datetime
  • keyword

Parameters

Sort order options

Usage

The sort parameter accepts an array of sort objects, allowing multiple field sorting with different orders.

Examples

Single field sort

Sort by timestamp in descending order (newest first):

Multiple field sort

Sort by priority (descending) first, then by created_at (ascending):
When multiple sort fields are specified, the sorting is applied in the order they appear in the array. Documents are first sorted by the first field, then by the second field for documents with the same first field value, and so on.