Deleting a document withing collection is not done when using the document (sometimes)

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.2
    • Component/s: None
    • None
    • Environment:
      Windows, Linux
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Consider that we have a document with some fields. If I try to delete like below, it can happen sometimes that it is not deleted in some occasions without returning any exception and/or WriteResult error:

      DBObject q = new BasicDBObjectBuilder().start().add("_id", new ObjectId(id)).get();
      DBCursor res = mongoDBConnector.getContacts().find(q);
      if (res.hasNext())

      { mongoDBConnector.getContacts().remove(res.next()); }

      However, I can delete successfully by using the field _id of the document like below:

      DBObject q = new BasicDBObjectBuilder().start().add("_id", new ObjectId(id)).get();
      mongoDBConnector.getContacts().remove(q);

            Assignee:
            Eliot Horowitz (Inactive)
            Reporter:
            Amir Moulavi
            None
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: