I have a Channels collection
{
channel: "Xamper", //unique
subscribers: [
ObjectId("5a934e000102030405000000"),
ObjectId("5a934e000102030405000001"),
ObjectId("5a934e000102030405000002")
]
}
And a Users collection
{
_id: ObjectId("5a934e000102030405000000"),
name: "Bradman"
},
{
_id: ObjectId("5a934e000102030405000001"),
name: "Hartin"
},
{
_id: ObjectId("5a934e000102030405000002"),
name: "Migra"
},
{
_id: ObjectId("5a934e000102030405000004"),
name: "Polycor"
}
Now I need to find with Channel name "Xamper" and count the users which are not in subscribers array
So the output will be
{
channel: "Xamper",
unSubscribers: 1
}
Which is similar to the outer excluding join of SQL
