Mongocxx-application: abort() has been called

I am trying to get a code example running that I found here.
mongocxx::database db = client[“testdb”];
mongocxx::collection coll = db[“testcollection”];

auto builder = bsoncxx::builder::stream::document{};
bsoncxx::document::value doc_value = builder
    << "name" << "MongoDB"
    << "type" << "database"
    << "count" << 1
    << "versions" << bsoncxx::builder::stream::open_array
    << "v3.2" << "v3.0" << "v2.6"
    << bsoncxx::builder::stream::close_array
    << "info" << bsoncxx::builder::stream::open_document
    << "x" << 203
    << "y" << 102
    << bsoncxx::builder::stream::close_document
    << bsoncxx::builder::stream::finalize;

When I run the code in VS 2019, I get the following error:

What should I do?

Hi @Simon_Reitbauer,

It would be helpful if you could provide the program code example, so that other could help debug the issue better.

Could you also provide:

  • MongoDB C++ driver version
  • if any, other error messages


I’ve solved this issue, you can delete this topic because it doesn’t contain informations that might be helpful for others.

Hi @Simon_Reitbauer,

I’m glad that you’re able to solve the issue. If you could share the problem and how did you solve it, it may be helpful to others encountering a similar issue in the future.


1 Like