Facing problem while executing element operators

i have connect to class atlas cluster from mongo shell and then i was running query i.e;
db.movies.find({viewerRating :{$type:“int”}}).pretty() so it doesn’t executed properly and my mongo shell version is 4.0.10 so what should i do.

Hey @Akash_06246

So after copying your supplied command I received a syntax error from the shell.


However all I had to do was change the quotes by deleting them and retyping them. Are you using a special character for your quotes?

You can see the difference in quotes from the screenshot above. Very slight difference but the shell does not like the special quotes I suppose.

The following command works for what you want

use video
db.movies.find({ viewerRating: { $type:"int" } }).pretty()
1 Like

It worked thanks for your help.