Getting Syntax error

Hi All,

I am getting below syntax error in below command, please suggest.

var pipeline = [{
$match : {< deleted > }
}
];

Error:
2019-07-20T13:42:53.337+0530 E QUERY [js] SyntaxError: invalid property id @(shell):1:28

Hi Mohit_29117,

I suggest you to take a closer look to the syntax of queries.
The fields inside it shouldn’t be put inside curly brackets.
I.e. instead of .find({ { “imdb.rating” : 5 } }) (that’s how you wrote) you should write .find({ “imdb.rating”: 5 })

Hey @Mohit_29117

As @Egor_49591 you will have to look at your syntax. Please see the docs for more info on how to form your pipeline. Take a look at this example.

db.articles.aggregate([
  { 
    $match: { 
      score: { $gt: 70, $lt: 90 }, 
      views: { $gte: 1000 } 
    }
  }
]);

P.S.
Be careful posting any code that is too close to any answers or attempted answer for the Labs or exam. See what happened in this post

@Mohit_29117

Please follow Forum guidelines and do not post code, or answers or potential answers in the Forum. I have edited your post to remove that. Thanks.