Docs Home → Launch & Manage MongoDB → MongoDB Atlas
1
Connect to your cluster in mongosh
.
Open mongosh
in a terminal window and connect to your
cluster. For detailed instructions on connecting, see
Connect via mongosh
.
2
Switch to the sample_training
database.
Run the following command at mongosh
prompt:
use sample_training
switched to db sample_training
3
Run the following $unionWith
with an Atlas Search $search
query.
The following query searches both the companies
and
inspections
collections for the term mobile
in the name
and business_name
fields respectively.