Docs Home → View & Analyze Data → MongoDB Atlas Data Lake
Run Queries Against Your Data Lake Dataset
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 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 for the Data Lake dataset that is a snapshot of data in the
sample_mflix.movies
collectionConnect to Your Federated Database Instance 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)