[JAVA-892] DefaultDBCallback.objectDone() creates invalid DBRef objects according to mongodb spec Created: 21/Jul/13  Updated: 04/Aug/16  Resolved: 04/Aug/16

Status: Closed
Project: Java Driver
Component/s: Codecs
Affects Version/s: 2.11.2
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Nick Lloyd Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

In the official mongodb jstest dbref3.js (https://github.com/mongodb/mongo/blob/r2.4.5/jstests/dbref3.js) a DBRef must meet the following criteria:

  • contain $ref and $id fields
  • $ref must be the first field in the JavaScript object
  • $id must be the second field in the JavaScript object
  • the value associated with $ref must be a String

Currently the Java driver only checks if the two fields exist and performs a naive toString() on the $ref value.



 Comments   
Comment by Jeffrey Yemin [ 04/Aug/16 ]

Duplicates JAVA-855

Comment by Nick Lloyd [ 23/Jul/13 ]

https://github.com/mongodb/mongo-java-driver/pull/131

Fix included in this pull request along with test coverage.

Generated at Thu Feb 08 08:53:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.