Not getting any data from db.movieDetails.find({runtime: {$gt: 90}}) in the mongo shell

image

it doesn’t return any data. A couple of days ago it was working.

1.You could be connected to a different cluster.
2.You could be using a different database.
3.The collection might have change.

I suspect item 2.

It looks like I am connected though. I might be wrong. I failed to mention that I am using the same cluster on my compass at the same time but I think that should not be a problem because I have done that in the past. Once again, I might be wrong.

Sorry for wasting your time. I was able to get some data once I disconnected the cluster from my compass and entered the query in the shell. I commenced to connect the cluster to my compass again and now both compass and shell are now able to return data queries. I have to admit that was kind of weird. Thank you @ steevej-1495

Please see your first snapshot closely.You were connected to test db as per your connect string
You did not switch the db.That’s why your query is not giving any results
In second attempt you switched DB by use video

1 Like

That is why I suspected point 2. In fact I was sure that it was the problem but the user has to work a little bit because in real life they will have to find their mistake themselves.

2 Likes

Yes! you are right. Good eye sir. So it had nothing to do with the cluster being connected to compass at the same time. That’s why it felt weird.

Thanks @ Ramachandra_37567

Closing this thread as the issue has been resolved.