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

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: legacy-1.0.0
    • Component/s: API
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

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

              Created:
              Updated:
              Resolved: