Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-253

update not working correctly - or doc bug

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.4
    • API
    • None

    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);

      Attachments

        Activity

          People

            eliot Eliot Horowitz (Inactive)
            rn@deftlabs.com Ryan Nitz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: