[JAVA-253] update not working correctly - or doc bug Created: 10/Jan/11  Updated: 17/Mar/11  Resolved: 12/Jan/11

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: 2.4
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Ryan Nitz Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I'm not 100% sure this is a Java bug, it may be a server or doc bug.

The following code fails to insert an object. If you change the last param (in the update method - multi = true) to false then this works as expected.

If this is the expected behavior, let me know and I will update the Javadoc comment for the method.

final ObjectId OBJ_ID = new ObjectId("4d09359b1cc223ebd7f9797f");

final BasicDBObject version = new BasicDBObject(ID, OBJ_ID);
version.put("prodVersion", pProdVersion);
version.put("devVersion", pDevVersion);

version.put("modified", now());

collection.update(new BasicDBObject(ID, OBJ_ID), version, true, true);



 Comments   
Comment by Ryan Nitz [ 12/Jan/11 ]

Great... I'll update the javadocs to clarify.

Comment by Eliot Horowitz (Inactive) [ 12/Jan/11 ]

You'd get an error with that if you were using safe mode

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