Docs Menu

Docs HomeLaunch & Manage MongoDBMongoDB Atlas

Use Operators and Collectors in Atlas Search Queries

On this page

  • Operators
  • Collectors
  • Continue Learning

The $search aggregation pipeline stage has the following operators:

Operator
Description
autocomplete
Performs a search-as-you-type query from an incomplete input string.
Combines other operators into a single query.
Queries fields in embedded documents, which are documents that are elements of an array.
Works in conjunction with the boolean and objectId data types.
Tests for the presence of a specified field.
Queries for values with specified geo shapes.
Queries for points within specified geographic shapes.
Queries both single value and array of values.
(Deprecated) Performs semantic search using Hierarchical Navigable Small Worlds algorithm.
Queries for similar documents.
Queries for values near a specified number, date, or geo point.
Searches documents for terms in an order similar to the query.
Supports querying a combination of indexed fields and values.
Queries for values within a specific numeric or date range.
Interprets the query field as a regular expression.
(Deprecated) Specifies relative positional requirements for query predicates within specified regions of a text field.
Performs textual analyzed search.
Supports special characters in the query string that can match any character.

Collectors return a document representing the metadata results, typically an aggregation over the matching search results.

The Atlas Search aggregation pipeline stage has the following collector:

Operator
Description
Groups query results by values or ranges in specified, faceted fields and returns the count for each of those groups.

Follow along with this video to learn how to search fields in embedded documents using the embeddedDocument operator, how to perform fuzzy search using the text operator fuzzy option, how to build search-as-you-type function using the autocomplete operator, how to run geospatial queries using the geoWithin and geoShape operators, how to retrieve similar or alternate results using the moreLikeThis operator, and how to display search terms in their original context using highlighting.

Duration: 12 Minutes

←  $searchMetaautocomplete →