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
Proposal: Allow users to specify conflict resolution function for merge
#873
Comments
Is it an attempt to address #186 ? |
Forget my question, I didn't see #872. |
I just answered a question on SO that would have benefited from this: http://stackoverflow.com/questions/27999748/count-the-different-variables-in-an-array-in-my-document/28007968#28007968 . @danielmewes, we should maybe think about scheduling this during the next ReQL discussion period if anyone has time for ReQL features. |
What would the user return from |
@coffeemug -- what do you mean? |
I think that instead of a second argument, we should use a |
Never mind, my question was silly. You'd obviously expect them to return the value they want to keep. |
How would this interact with recursive merge? I would expect that there would be no recursion if merge was given a conflict resolution function. That raises the question of how to handle queries like Returning |
👍 for everything @AtnNn said above -- that's a great spec! (though I think |
Ah, right, I forgot that We could potentially get around this in the server by having a rule that if the |
I agree with @AtnNn that we should call the function right away rather than recursing. I'm not sure what we should do with |
While we generally seem to agree on this, there are two important questions left so I think we should reschedule this discussion for after 2.1. We still need to figure out
|
Has this been implemented or is there a similar way to accomplish this? Would be really useful for this use case. |
@chacalle No, we have not gotten to this yet. |
Users will be able to provide a function to
merge
like so:Where for every conflict in the two objects, the block will be called with the key in question, the left value, and the right value. (In the example above, the block will be called once with the arguments
'b'
,2
, and3
.)The text was updated successfully, but these errors were encountered: