Hướng dẫn mongodb atlas query syntax
Docs Home → MongoDB Atlas ➤ Use the Select your language drop-down menu to set the language of the examples on this page. ImportantFeature unavailable in Serverless InstancesThis part of the tutorial guides you through running Atlas Search queries. Now that you ran some queries, review the Atlas Search documentation to learn more about the different operators and other queries you can run. More query examples are available througout the Atlas Search documentation. Prefer to learn by watching? Follow along with this video tutorial walk-through that demonstrates how to build Atlas Search queries for a Restaurant Finder demo application, which is also available at www.atlassearchrestaurants.com. Duration: 20 Minutes Docs Home → MongoDB Atlas On this page
OverviewMongoDB Atlas provides an easy way to host and manage your data in the cloud. This tutorial guides you through creating an Atlas cluster, connecting to it, and loading sample data. You can get started with Atlas through the Atlas CLI or the Atlas User Interface. Select a tab based on how you would like to get started: On this page
Docs Home → MongoDB Manual MongoDB offers a full-text search solution, MongoDB Atlas Search, for data hosted on MongoDB Atlas. A legacy text search capability is available for users self-managing MongoDB deployments. This page describes $text
The
The
If using the
In the The NoteThe To match on a phrase, as opposed to
individual terms, enclose the phrase in escaped double quotes ( If the For example, passed a
The Prefixing
a word with a hyphen-minus (
The The For case insensitive and diacritic insensitive text searches, the
For
case sensitive search (i.e. For diacritic sensitive search (i.e. Changed in version 3.2. The
To support case sensitive search where the When performing a case sensitive search (
For case sensitive search (i.e. Specifying TipSee also:Changed in version 3.2. The
To support diacritic sensitive text search against the version 3 Text searches against earlier versions of the To perform a diacritic sensitive text search (
Specifying To perform a diacritic sensitive search against an earlier version of the For diacritic sensitive search, if the suffix stem contains the diacritic mark or marks, the TipSee also:The The following examples assume a collection
Populate the collection with the following documents:
The following query specifies a
This query returns the documents that contain the term
TipIf the search string is a space-delimited string,
The following query specifies a
This query returns documents that contain either
TipTo match the exact phrase as a single term, escape the quotes. The following query searches for the phrase
This query returns documents that contain the phrase
TipSee also:A negated term is a term that is prefixed by a minus sign The following example searches for documents that contain the words
The query returns the following documents:
TipUse the optional If
you specify a language value of The following query specifies
The query returns the following documents:
The
TipSee also:Changed in version 3.2. The The following query performs a case and diacritic insensitive text search for the terms
Using the version 3
With the previous versions of the TipChanged in version 3.2. To enable case sensitive search, specify The following query performs a case sensitive search for the term
The search matches just the document:
TipThe following query performs a case sensitive search for the phrase
The search matches just the document:
TipA negated term is a term that is prefixed by a minus sign The following example performs a case sensitive search for documents that contain the word
The query matches the following document:
TipChanged in version 3.2. To enable diacritic sensitive search against a version 3 text index, specify The following query performs a diacritic sensitive text search on the
term
The query only matches the following document:
TipThe The following query performs a diacritic sensitive text search for document that contains the term
The query matches the following document:
TipThe following query performs a text search for the term
The returned document includes an additional field
TipSee also:
TipSee also:Use the The following
query searches for the term
TipSee also:The following query searches for documents where the
TipSee also: |