0

I have users collection from this collection I need to fetch all the matching documents that either contain the name field whose value is null or that do not contain the name field. I have tried a couple of ways but I did not get the expected output.

Query:

Users.objects(__raw__={ 'name': null }) 

This gives me an error NameError: name 'null' is not defined

Any idea how to fetch all the matching documents that either contains the name field whose value is null or that do not contain the name field? Thank you in advance.

Sandeep
  • 13
  • 4

1 Answers1

0

I have figured out the right query for fetch all the matching documents that either contains the name field whose value is null or that do not contain the name field.

Query

Users.objects(name=None)
Sandeep
  • 13
  • 4