Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-845

Documents in array sent with insert command are all index 0

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2-rc0
    • Affects Version/s: None
    • Component/s: Bulk API, libbson
    • Labels:
      None

      An array in BSON is just a document with the keys "0", "1", "2", and so on. When sending an array of documents with the "insert" command, the driver should generate BSON like:

      { "insert" : "test", "writeConcern" : {  }, "ordered" : false, "documents" : { "0": { "_id" : 1 }, "1": { "_id" : 2 }, "2": { "_id" : 3 } } }
      

      Instead it sends:

      { "insert" : "test", "writeConcern" : {  }, "ordered" : false, "documents" : { "0": { "_id" : 1 }, "0": { "_id" : 2 }, "0": { "_id" : 3 } } }
      

      The server accepts this, but it's not up to spec.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: