Lab 1 - Syntaxt Error

var pipeline = [ { $match: { {‘imdb.rating’: {$gte: 7 }},{rated: {$in: { “PG”, “G”} }},{genres: {$nin: [“Crime”, “Horror”] }},{languages: { $all: [ “English” , “Japanese”] }} } } ]

Why is the above query failing and giving the error below:
E QUERY [js] uncaught exception: SyntaxError: expected property name, got ‘{’ :
@(shell):1:29

{ “PG”, “G”} got it. The 2 values should be in square brackets instead of curly braces.

Thanks

1 Like