Search code examples
mongodbmongodb-querymongodb-compass

MongoDB Compass Community: $match in aggregation gives “Expected ”[“ or AggregationStage but ”{“ found.”


I'm using MongoDB Compass Community version 1.17.0. While trying to use $match as the first step, it's giving me this message

enter image description here


Solution

  • Remove new in front of Date from your query.

    Use this

    {
      utcDate: { $gt : Date("2019-04-01") }
    }