Navigation

The $search Aggregation Pipeline Stage

On this page

  • Definition
  • Behavior
Important

Looking for $searchBeta? Use $search instead, the official aggregation stage for running search queries.

Atlas Search queries take the form of an aggregation pipeline stage. The $search stage performs a full-text search on the specified field or fields which must be covered by an Atlas Search index.

A $search pipeline stage has the following prototype form:

{
$search: {
<operator>: {
<specification(s)>
}
}
}

$search must be the first stage of any pipeline it appears in. $search cannot be used in:

Tip
See also:
Give Feedback

On this page

  • Definition
  • Behavior