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

Impove the BCON_APPEND_CTX() function for being called multiple times to add multiple values to same bson array

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.25.0
    • Affects Version/s: 1.9.1, 1.9.2, 1.9.3
    • Component/s: libbson
    • Environment:
      linux
    • Not Needed

      While adding elements in a bson array, you should call BCON_APPEND_CTX() , but all elements must be placed in the parameter position at onceļ¼Œjust like BCON_APPEND_CTX(query, &ctx, "$each", "[", BCON_INT64((int64_t)num[0]), BCON_INT64((int64_t)num[1]), BCON_INT64((int64_t)num[2]) "]") ; However, the number of array elements is unknown, it's difficult to add all elements in the bson array for just calling BCON_APPEND_CTX() one time;
      It's need for me to call Call BCON_APPEND_CTX multiple times to add multiple values to the same bson array.

        1. bcon.c
          27 kB

            Assignee:
            Unassigned Unassigned
            Reporter:
            haveTryTwo liuzhongchao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: