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

Convenient API to create BSON arrays

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.25.0
    • None
    • None
    • None

    Description

      Using method like https://api.mongodb.org/libbson/current/bson_append_int32.html, it appears that API consumers can choose the key for values not just in documents, but also in arrays. This will create BSON documents that violate the BSON spec: which says:

      Array - The document for an array is a normal BSON document with integer values for the keys, starting with 0 and continuing sequentially. For example, the array ['red', 'blue'] would be encoded as the document {'0': 'red', '1': 'blue'}. The keys must be in ascending numerical order

      This has caused users some problems when consuming documents created by the C driver. See JAVA-1618.

      Attachments

        Activity

          People

            kevin.albertson@mongodb.com Kevin Albertson
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: