Here i want to get AC3 phones list whose price is greater than 200 using aggregation
db.Products.aggregate([{$match:{name:"AC3 Phone"}},{$project:{_id:0,cost:{$price:{$gte:200}}}}]
when i executed above command in mongo shell,this is the error i got
"ok" : 0,
"errmsg" : "Unrecognized expression '$price'",
"code" : 168,
"codeName" : "InvalidPipelineOperator"
My doubt is that can we use $gte operator in projection phase using aggregations in MongoDB as mentioned in above