I run a query that return an array of users through an aggregation. In order not to return the document of the user performing the query, I added a $filter on his id. But I receive the following error:
$filter is not allowed in this atlas tier.
I am connected to a free MongoAtlas cluster. Here is my code.
User.aggregate([
{ $filter: { _id: { $eq: id } } },
{
$match: {
jobs: { $in: jobs },
age: { $gte: minAge, $lte: maxAge },
},
},
]).exec((_, data) => res.json({ data }));
How to fix this?
所有评论(0)