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

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor - P4 Minor - P4
    • None
    • 2.6.1
    • API

    Description

      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"?

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: