That is a tricky one and I hope somebody will come up with a simpler solution.
Read Formatting code and log snippets in posts before posting code or documents next time. I could not just copy your documents because they were not formatted correctly.
My solution involves an extra collection. This extra collection would contains the empno you want to query. In your case it would be:
{ "_id" : 123 }
{ "_id" : 333 }
Then using the aggregation pipeline on that extra collection you $lookup into your main collection to find matches as the first stage. Then a $match stage will remove the documents for which an emp was found in the main collection.
lookup =
{
"$lookup" : {
"from" : "Sudhesh_Gnanasekaran",
"localField" : "_id",
"foreignField" : "empno",
"as" : "found"
}
}
match = { "$match" : { "found.0" : { "$exists" : false } } }
// running the pipeline
db.wanted.aggregate( [ lookup , match ] )
// would produce
{ "_id" : 333, "found" : [ ] }
// you could then add $project stage to remove the empty array
// you could even add a $out stage to store the result in another collection