Run Queries Against Your Data Lake Dataset - Preview
On this page
This page guides you through the steps for running queries in
mongosh
against Data Lake dataset for the sample_mflix.movies
collection.
Prerequisites
Before you run the queries, you must complete the following using the examples shown in the procedures:
Create an Atlas Data Lake Pipeline - Preview for the
sample_mflix.movies
collection(For On Demand schedule only) Manually trigger Ingestion of data from your snapshot
Set Up a Federated Database Instance for Your Dataset - Preview for the Data Lake dataset that is a snapshot of data in the
sample_mflix.movies
collectionConnect to Your Federated Database Instance - Preview to run the queries
Procedure
Copy, paste, and run the following queries in your terminal.
The following queries use the sample_mflix.movies
collection
for which you created the pipeline.
Find movie with the title The Frozen Ground
released between
2010 and 2015:
db.Collection0.find({ "year": {$gt: 2010, $lt: 2015}, "title": "The Frozen Ground" }, {"title": 1, "year": 1, "genres": 1 })
Find all movies whose title includes the word Ground
and
limit the number of documents returned to 10
.
db.Collection0.find({ "year": {$gt: 2010, $lt: 2015}, title: /Ground/ }, {"title": 1, "year": 1, "genres": 1 }).limit(10)