-1

I want find the paths in mongodb which also contains None values if path is not present in database.

But problem is "IN" clause query only consider values which exists.

Here is my code.

veye_path = [path['dir_path'] for path in veye_db.find({"uuid": {"$in": binary_veye_uuid}})]

I also want to include None values as well.

Hiba Rehman
  • 127
  • 2
  • 9

1 Answers1

0

You could try:

{'$or': [{"uuid": {"$in": binary_veye_uuid},{"uuid": {"$exists": false}]}
D. SM
  • 13,584
  • 3
  • 12
  • 21