Database

[{"collection":"Genre","count":20,"content":{"book_id":{"type":"int","min":0,"max":99}}},{"collection":"Books","count":100,"content":{"book_id":{"type":"stringFromParts","parts":[{"type":"int","min":0,"max":100}]}}}]

Query

db.Genre.aggregate([{"$lookup":{"from":"Books","let":{"book_idStr":{"$toString":"$book_id"}},"as":"books","pipeline":[{"$match":{"$expr":{"$eq":["$$book_idStr","$book_id"]}}}]}},{"$match":{"$expr":{"$gt":[{"$size":"$books"},0]}}},{"$unset":"books"}])

Result