Let's assume I need to verify every document in a CosmosDB collection has AnImportantProperty
set up (= property exists, may have explicit value null). Most of them do, but for "reasons", some of them may not.
I can include the new property to indexing policy, so I can easily find which documents are OK with an index-covered query:
select * from c where is_defined(c.AnImportantProperty)
But the opposite query (which is what I'm really interested in) does not seem to benefit from the index:
select * from c where NOT is_defined(c.AnImportantProperty)
Is there a way to write an index/query to find documents with missing property without a full scan?
EDIT: For example, I've heared some second-hand rumors about negated indexes and a mysterious "v2 index". Both may indicate there is (or will be) a solution to this scenario.