go-kivik / kivik

Common interface to CouchDB or CouchDB-like databases for Go and GopherJS
Other
316 stars 44 forks source link

x/mango: Fix evaluation of `$exists: false` always failing #1044

Closed skaggmannen closed 2 months ago

skaggmannen commented 2 months ago

This PR fixes the evaluation of $exists: false by making fieldNode.Match() always pass the value to the condition, even if it is not found in the map.

It also makes it possible to do subfield lookups using dot notation (e.g. foo.bar.baz) as mentioned in the CouchDB documentation.

This PR fixes https://github.com/go-kivik/kivik/issues/1043.

flimzy commented 2 months ago

Thanks for submitting a PR! I see one small improvement that needs to be made, but I'll do that in a follow-up PR, as I have the relevant code already elsewhere in the repo. I'll just move it into place, then cut a new release.