The $search
Aggregation Pipeline Stage¶
Important
Looking for $searchBeta
? Use $search
instead, the official
aggregation stage for running search queries.
Definition¶
$search
¶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)> } } }
Behavior¶
$search
must be the first stage of any pipeline it appears in.
$search
cannot be used in:
- a view definition
- a
$lookup subpipeline
- a
$facet
pipeline stage
Tip
See Also:
Give Feedback