why i m getting thois error.why aggregation is faild here …
db.wallpost.aggregate([{
$match: {
$and: [
{ $or: [
{ postType: 1 },
{ postType: 2 },
{ postType: 3 },
{ from: ObjectId("61e96b26a88909603ea95ffc") },
{ timeZone:"Asia/Kolkata" }
]},
{ from: { '$in': ["5ff58fa655bd3c5769319c08"] } },
{ postType: { $ne: 3 } },
{ isDelete: 0 },
]},
'$lookup': {
from: 'blockwallpost',
localField: '_id',
foreignField: 'wallpost',
as: 'blockWallUser'
},
$addFields: {
"feed_Block_filter": {
"$filter":{
input:"$blockWallUser",
"as": "feed_Blocked",
"cond": {
"$eq": ["$$feed_Blocked.user", "$userId"],
cond: {
"$eq": ["$$feed_Blocked.wallpost","_id"]
},
}
}
}
}},
{ $project: {"_id_id":0,"place":1} }
]).toArray
uncaught exception: Error: command failed: {
"ok" : 0,
"errmsg" : "A pipeline stage specification object must contain exactly one field.",
"code" : 40323,
"codeName" : "Location40323"
} : aggregate failed