How to Sort Your Atlas Search Results
On this page
This tutorial describes how to sort the Atlas Search results
by numeric, date, and string fields in the sample_mflix.movies
collection in ascending or descending order. It also demonstrates how to
perform a case-insensitive sort of your Atlas Search results.
When you create an Atlas Search index on a collection, you can configure the
index to normalize the value of a string field to lowercase. This allows
you to sort your query results regardless of the sorted field's letter
case.
Before you begin, ensure that your Atlas cluster meets the requirements described in the Prerequisites.
Required Access
To create an Atlas Search index, you must have Project Data Access Admin
or higher access to the project.
Load the Sample Data
Create the Atlas Search Index
Overview
Procedure
Sort Your Search Results
➤ Use the Select your language drop-down menu to set the language of the example in this section.
You can sort your search results in multiple ways. In this section, you
connect to your Atlas cluster and then run the sample queries
against the indexed fields in the sample_mflix.movies
collection.