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

bulk API input parameter does not have "fsync" or "journal", is fsync=false, journal=false always used?

    XMLWordPrintableJSON

Details

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

    Description

      Looks there are 2 ways to do the bulk insert:
      1. the older way, i.e. insert a vector via mongo::DBClientConnection insert() API.
      2. the newer way, i.e. use mongo::BulkOperationBuilder insert() and execute() API.

      To check errors for #1, we call getLastError(const std::string &db, bool fsync=false, bool journal =false, int writeconcern=0, int wtimeout=0)

      To check errors for #2, call mongo::BulkOperationBuilder execute (const WriteConcern *writeConcern, WriteResult *writeResult), second parameter will provide the error code.

      For #2, the API allow us to specify writeconcern, but not fsync or journal.
      I have following questions:

      1. is #2 the recommended way to do bulk operations?
      2. If so, is there a way to specify fsync and journal when we use the #2 .
      3. If we do not use bulk API, i.e. we insert 1 document at a time what is the recommended way to check errors?
      4. Is that true that getLastError() is going to be deprecated?

      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: