Check for missing field or null value in mongoDB atlas

query is a small part of a very big query which also include the search on text , date, string, number, objectId types and uses custom analyzers, combinations of $must, $mustNot, $should, $filter etc. I can use compound in $search but not in $match.

Thanks for providing those details and clarifying the use case although unfortunately I’m not aware of how this can be done for array fields containing null value(s) off the top of my head or if it can be done at all.

I can also see you have raised another post in regards to this so I will also go ahead and close this post off since we have discussed a few possible solutions / workarounds specific to this post.

Regards,
Jason

2 Likes