-
Notifications
You must be signed in to change notification settings - Fork 25
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
remove _rev property from docs & fix doc mutation #3
Conversation
@@ -8,6 +8,8 @@ if (typeof window !== 'undefined' && window.PouchDB) { | |||
PouchPromise = typeof global.Promise === 'function' ? global.Promise : require('lie'); | |||
} | |||
|
|||
var clone = require('lodash.clone'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually have a special module called pouchdb-exend
. We use it because other ones gave us errors related to using Ember with IndexedDB.
I tend to oppose this commit for a few reasons:
I totally understand where you're coming from with wanting to do your own deep comparison and not have to worry about |
For doing a particular action if the document exists vs. if it doesn't, couldn't you just check if |
Yes, but to me, it's clearer to check the |
(see added comments about how documents are mutated after being returned)
Alright, I added a test to demonstrate the 2nd kind of doc mutation that the As for the removal of But, if we got rid of Also, it does seem a little weird to have a property that the mutation of does nothing to change the result. Of course. this is true of |
That's a good point, however I think your I understand where you're coming from, but I think I'm going to be that jerk and close this pull request in favor of the other solution. I encourage you to submit a pull request to fix the Thanks for your input! |
Foillow-up: #7 |
Yeah, feel free to use the test case (as well as any other code you want). And yeah clone can be used without omitting |
As for changing behaviour based on the |
@slang800 Yep, all CouchDB implementations have the format The only part that's quasi-standard is what comes after the hyphen. PouchDB just generates a random number, whereas CouchDB calculates a checksum of the entire document in order to dedup duplicate changes across multiple nodes. There's very little harm in us implementing it the way we do, and in fact it would be impossible, since the checksum implementation requires Erlang strings. But that's a whole other discussion; there's an open issue somewhere in CouchDB to make the revs truly deterministic. :) |
closes #2 and makes some improvements to the readme. this would require a major version bump.