Open KarneAsada opened 12 years ago
Short answer: It is intentional.
I agree it seems strange. I originally implemented this behavior because that's what mongodb-native did. But that's a good enough reason as any to reconsider.
In order to not insert the property I would either have to clone the entire structure or keep track if it needed to be added and remove it again at the end.
I'll keep this issue open for now.
It's good to know I wasn't doing something wrong.
I'll just keep this functionality in mind and make sure I clone the object before insertion if I need to re-use it.
Thanks.
I noticed that when passing an object to insert, the _id property is added to the original object via reference. Is this intentional? It seems slightly strange and I've been cloning the object before passing it to insert to prevent this.