Skip to content
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

Fix of DBRef resaving/deserialization weird behaviour #261

Merged
merged 1 commit into from Jun 25, 2011
Merged

Fix of DBRef resaving/deserialization weird behaviour #261

merged 1 commit into from Jun 25, 2011

Conversation

adamansky
Copy link
Contributor

Using mongodb driver with native deserializer i've descovered strange bug:
1 Object created and saved with DBRef field
2 Then loaded (deserilizer processed their fields) and saved again.
3 After saving DBRef field became corrupted! IMHO due to $db field value (empty string) in DBRef //see patch

I've created test case and fix.

PS.
All test cases checked agains pure BSON serializer! Regardless of 'native_parser' option value!
Due to small typo:

var client = new Db(MONGODB, 
new Server("127.0.0.1", 27017, {auto_reconnect: true, poolSize: 4, 
 native_parser: (process.env['TEST_NATIVE'] != null) ? true : false}));

But correct:

var client = new Db(MONGODB, 
new Server("127.0.0.1", 27017, {auto_reconnect: true, poolSize: 4}), 
{native_parser: (process.env['TEST_NATIVE'] != null) ? true : false});

@christkv christkv merged commit 050ef29 into mongodb:master Jun 25, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants