Db.movies.aggregate(pipeline).itcount() give no response

Step 1) I connected using the connection string:
mongo “mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/aggregations?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl -u m121 -p aggregations --norc

NO ERRORS

Step 2) show dbs

100YWeatherSmall 0.128GB
admin 0.000GB
aggregations 0.068GB
citibike 0.367GB
city 0.002GB
config 0.015GB
coursera-agg 0.083GB
feedback 0.000GB
local 0.710GB
mflix 0.449GB
results 0.000GB
ships 0.001GB
video 0.513GB

NO ERRORS

Step 3) use aggregations
Fine it works

Step 4) show collections
air_airlines
air_alliances
air_routes
bronze_banking
child_reference
customers
employees
exoplanets
gold_banking
icecream_data
movies
nycFacilities
parent_reference
silver_banking
solarSystem
stocks
system.profile

Fine it works

Step 5) db.movies.findOne()
It also works and give response as expected

Step 6) load(‘validateLab1.js’)
mongo shell return true

Step 7) var pipeline = [ { $match: {“imdb.rating”: { $gte: 7 } } } ]

NO syntax error

BUT the moment I hit
validateLab1(pipeline)

Mongo Shell give no response : (

NO EORROR NO WARNING nothing . . . But if I put some un expected value in pipeline then it print “var pipeline isn’t properly set up!” OR if there is any syntax error in pipeline it print error message

I have tried to print hello in validateLab1.js file and then load I get to know that code blocks at var result = aggregations.movies.aggregate(pipeline).toArray().length

Also If I type

db.movies.aggregate([{ $match: { ‘imdb.rating’: { $gte: 7 } } }])

I got my expected response

This is blocking me from completing the lab.

PLEASE HELP

Thanks,
Lovepreet Singh

Hi @Lovepreet_Singh1,

I can check that you have already completed the Lab: $match. If you still have any questions, please feel free to reach out.

Kind Regards,
Sonali