Missing : ? I do not see a missing colon

The error message says

[js] uncaught exception: SyntaxError: missing : after property id :

Meaning there is a colon missing somewhere. But I have checked and checked again, and all of my $ query expressions have colons:

var pipeline = [{$match: {imdb.rating: {$gte: 7}}, {$or: [{genres: {$ne: “Crime”, “Horror”}}, {“rated”: “PG”, “G”}, {languages: “Japanese”, “English”}]}]}

And when I enclose “imdb.rating” in quotes, that merely changes it to a different error message:

SyntaxError: expected property name, got ‘{’

Which, again, I checked and rechecked, and do not see any unpaired or out of place curlies.
Where is the missing colon?

The following is wrong

The docs do not help me to figure out what is wrong with it. That’s why I asked here. The example that comes up when I do the findOne() does not have a languages field that I could go by.

The following allows you to see the existence of field.

You may also use Compass to analyse the schema of a collection.

A good description of JSON is given at

The specific error with

is the following. Since English follows a comma it is treated as a field name, rather than a value.

1 Like

Thank you. I also found Compass’ pipeline builder helpful.

1 Like