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

Collection#save should also accept BSONObject (not just DBObject)

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.6.1
    • Component/s: API
    • Labels:

      I am working with BasicBSONObject (received from code that does not depend on MongoDB), and would like to save them to the database.

      Unfortunately, "save" and friends only accept DBObject, so that I have to copy all the data into a BasicDBObject first.

      Is it really necessary to only accept DBObjects? From what I can see, the only difference between the two is that DBObject has an "incomplete" flag, and the API checks it for you and prevents accidental upserts using incomplete objects. Can we accept other types of BSONObject and just treat them as "complete"?

            Assignee:
            Unassigned Unassigned
            Reporter:
            thiloplanz Thilo Planz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: