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

How to set _id in gridfs and append to a file in gridfs?

    XMLWordPrintableJSON

Details

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

    Description

      I can use gridfs to do the initial loading with storeFile function. How can I set the _id field for future appending data to the file?

      I think I should use GridFileBuilder class, but I didn't find any example in the cxx driver. Can someone help provide an example?

      Basically, I want insert data to
      dbname.collection_files:
      {_id:"unique_string", filename:"my_file_name"...}

      After a while, the "my_file_name" would have something append to the end, and I want to append the data based on "unique_string" to the gridfs for the same data.

      How can I do it?

      Thanks in advance!

      Attachments

        Activity

          People

            Unassigned Unassigned
            yuncong.zhang Yuncong Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: