I try to make big aggregation request in compass. I need to filter data by comparison of ObjectIds
{
_id: ObjectId("5fcc15d567184993fdfd8a24")
organizationId: ObjectId("5dc3b48f8f69a100022ab8d8")
relatedObject: {
organizationId: ObjectId("5dc3b48f8f69a100022ab8d8")
...
}
}
I need to get collections where organizationId = relatedObject.organizationId. Simple
$match {
organizationId: { $eq: "$order_history_items.organizationId" }
}
doesn't work and response nothing. I suppose because of ObjectIds comparison. What should I do without toHexString() or similar stuff which isn't available in compass?