Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-907

how to get object size when constructing update_one

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 3.0.1
    • API
    • None
    • Linux

    Description

      I am starting to migrate from legacy driver 1.0.6 to new c++11 driver 3.0.1.
      In legacy driver, when we do bulk write, we were able to keep statistic information for the object to be updated. e.g:

      loadCountInBytes_ += record.objsize();
      bulk.find(BSON("EventId" << eventIDStr)).upsert().replaceOne(record);
      

      where variable "record" is of type "mongo::BSONObj" (in our use case, it's an insert 99% of the time)
      In new c++11 driver, what is the recommended way to track the above object size statistics (bytes loaded) since we are using the builders now (a filter builder and an update builder).
      Thanks!
      Judy

      Attachments

        Activity

          People

            Unassigned Unassigned
            Judy.Han Judy Han [X]
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: