-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mango queries with conflicts: true
return documents that do not have conflicts
#1101
Comments
Going over this on IRC I'm pretty sure the root cause of this bug is here: Using a partial filter index and removing the _conflicts check results in the correct results. Theoretically specifying r=2 in the options would also fix it but Fauxton apparently has issues encoding that and is passing [50] (i.e., ASCII "2") which is then ignored by Mango. |
Here are the index and selector I am using to detect conflicts:
Given a database with conflicted documents, using this selector with this index, whether with
I'm not sure what I'm doing wrong relative to the prescribed method. |
I was tired of adding and deleting DDocs when searching for conflicts in a DB so I've tried this simple Mango-query in Fauxton:
But no documents were returned even though conflicts existed. Might be because the "_conflicts" - key is not visible by default. It would help a lot if this was possible via Fauxton. |
This allows for using Mango queries for finding docs with conflicts. Closes #1101
Closing in favour of #1425 |
This allows for using Mango queries for finding docs with conflicts. Closes #1101
Queries to the
/{db}/_find
endpoint that setconflicts: true
return documents that do not include conflicts. I have documented a test case here that reproduces the issue.The documentation in cloudant/mango indicates that this is expected behavior:
However, it sure would be nice to issue queries that return only conflicted documents that match the given selector.
Expected Behavior
A query setting should exist to filter query results to only those that have conflicted and match the given selector.
Current Behavior
Setting
conflicts: true
returns documents with and without conflicts, such that the user must perform a second query to/_all_docs
to determine which documents actually have conflicts.Possible Solution
Setting
onlyConflicts
or otherwise-named query value should cause CouchDB to filter results of a query to only those documents that match a given selector and which have conflicts.Steps to Reproduce (for bugs)
I've developed a test case here using node.js.
Context
Detecting conflicts requires finding them first. In large databases, performing one query to find documents that may have conflicts and then another to determine which of them actually do creates considerable request overhead for applications attempting to detect or resolve conflicts proactively.
Your Environment
The text was updated successfully, but these errors were encountered: