tonysun83 commented on issue #863: Fix exists false when field is explicitly 
defined
URL: https://github.com/apache/couchdb/pull/863#issuecomment-334526790
 
 
   @willholley : It's worth noting that the behavior is going to be different 
because of how we perceive $exists "should" work. If we indexed everything, and 
we queried ```{"foo": {"$exists": false}}```, then we would return  all the 
documents in the db that did not have "foo" as a field in the document. 
However, if you explicitly indexed "foo", then you would get 0 results back 
because you only indexed the subset of documents that contained "foo" as a 
field. The large (all_docs)superset is not part of the index, and therefore 
would not be returned. So _all_docs, explicit json index, index everything, and 
explicit text index would all return different results. 
   
   Edit: looks like you're deferring to _all_docs as a special case for 
$exists:false here:
   
https://github.com/apache/couchdb/commit/503f3e34afa0a68e91258ca864e70ab18e6584e2
   
   Edit 2: So after giving it some thought, I think _all_docs and index 
everything(text) should return the same results. Explicitly defined json 
indexes and text indexes should return the same thing for a given query. But 
it's important to note that we'll be defaulting to _all_doc with single 
$exists: false query. Thoughts?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to