[JAVA-387] DBCollection#findOne(DBObject o, DBObject fields) doesn't markAsPartialObject Created: 24/Jun/11 Updated: 10/Aug/11 Resolved: 19/Jul/11 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | API |
| Affects Version/s: | 2.6.3 |
| Fix Version/s: | 2.6.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Marc Leidner | Assignee: | Antoine Girbal |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
/Applications/mongodb-osx-x86_64-1.8.1/bin/mongod |
||
| Description |
|
Looks like a bug in the driver where markAsPartialObject is not set when querying with findOne(DBObject o, DBObject fields). This code illustrates the behavior (at least on my machine): DBCollection col = new Mongo("localhost").getDB("test").getCollection("test"); // insert document with two fields: // prepare query and field selector: // call findOne to get object, returns full document: // call findOne to get object, now with only 'name' field, // try to save the returned document, this should throw an // call findOne to get object, now the 'company' field gone |
| Comments |
| Comment by Antoine Girbal [ 19/Jul/11 ] |
|
thanks for report. |
| Comment by auto [ 19/Jul/11 ] |
|
Author: {u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}Message: - |