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

uncought exception: find_and_update => precondition failed: bson

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.1
    • Component/s: None
    • None

      Hey there,
      I don't know which statement exactly causes the error. Last time I had this I accidentally changed parameters of the find_and_update - function. Now I finally can reproduce it =).
      Hope this is helpful,
      Armin

      // codesnippets

      {{ mongocxx::options::find_one_and_update TheOptions {};
      TheOptions.sort(vieOptions);

      std::cout
      << "78 - Find:\n" << bsoncxx::to_json(vieFind) << "\n"
      << "78 - Update:\n" << bsoncxx::to_json(vieUpdate) << "\n"
      << "78 - Options.sort:\n" << bsoncxx::to_json(vieOptions)
      << std::endl;

      ... collJobs.find_one_and_update(vieFind,vieUpdate,TheOptions);}}

      src/bson/bson.c:2193 bson_get_data(): precondition failed: bson
      process died.

      // consol:

      78 - Find:
      {
      "CServer" : {
      "error" : false,
      "dateEndLeadworker" :

      { "$exists" : true }

      ,
      "dateStartConversion" :

      { "$exists" : false }

      }
      }

      78 - Update:
      {
      "$set" : {
      "CServer" : {
      "dateStartConversion" :

      { "$date" : 1479621781745 }

      ,
      "machineConversion" : "MyMachine_f29a8bc8aee611e6a05f0024d74d9538"
      }
      }
      }

      78 - Options.sort:
      {
      "CServer" :

      { "dateEntry" : 1 }

      }

      // Stacktrace:

      {{__GI_raise (sig=6, sig@entry=6)
      __GI_abort ()
      bson_get_data ()
      (anonymous namespace)::find_and_modify(_mongoc_collection_t*, bsoncxx::v_noabi::view_or_value<bsoncxx::v_noabi::document::view, bsoncxx::v_noabi::document::value>, _mongoc_find_and_modify_opts_t const*) ()
      mongocxx::v_noabi::collection::find_one_and_update(bsoncxx::v_noabi::view_or_value<bsoncxx::v_noabi::document::view, bsoncxx::v_noabi::document::value>, bsoncxx::v_noabi::view_or_value<bsoncxx::v_noabi::document::view, bsoncxx::v_noabi::document::value>, mongocxx::v_noabi::options::find_one_and_update const&) () }}

            Assignee:
            rassi J Rassi
            Reporter:
            Weltenbummler Armin Ball [X]
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: