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
$rename source field invalid #4
Comments
Can you paste those JSON documents? If you want, you can also add test case to https://github.com/mirek/node-rus-diff/blob/master/spec/spec-index.coffee - I'll merge it and fix quickly. |
It would be great to add something smart to recognise $pop, $pull, $push etc. ops for arrays. Maybe I'll do that soon. |
Yeah that would be brilliant, I'm hitting the null issue referenced here: https://jira.mongodb.org/browse/SERVER-1014 I will have to do a clean up of the document afterwards. Thank you for this. |
I get a 403 when trying to sync change. Here is the test (which I think is correct?) assert.deepEqual { '$unset' : {'a.0':true} }, $.diff {a:['a','b']}, {a:['b']} |
So applying rename is broken for sure. |
It's because of delete behaviour:
I'll need to spend a bit more time on it because removing elements from the array is more "dynamic", in the sense that it changes indexes for other elements (ie. |
I'm not sure on the entire $rename concept here. How can producing a diff determine if something has been renamed? |
@kevinfairclough $rename has just been fixed, the behaviour is quite straight forward:
Worth noting is that values that changed to something else can't be used for $rename because MongoDB doesn't allow it, for example It's true that $rename is not necessary to compute diff. We can make it optional with the flag. |
Array of strings, remove first element.
diff() When comparing an array of strings with another array of strings and applying the diff I'm getting; $rename source field invalid.
{'$rename': {'Category:1':'Category:0'}}
The text was updated successfully, but these errors were encountered: