Skip to content

Commit 6c70982

Browse files
tamarothkevinAlbs
authored andcommitted
CXX-1689 Fix string_view to string conversion.
1 parent 5d684ff commit 6c70982

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mongocxx/database.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <bsoncxx/builder/basic/kvp.hpp>
2121
#include <bsoncxx/builder/concatenate.hpp>
2222
#include <bsoncxx/stdx/make_unique.hpp>
23+
#include <bsoncxx/string/to_string.hpp>
2324
#include <mongocxx/client.hpp>
2425
#include <mongocxx/exception/error_code.hpp>
2526
#include <mongocxx/exception/logic_error.hpp>
@@ -227,7 +228,7 @@ collection database::_create_collection(const client_session* session,
227228

228229
libbson::scoped_bson_t opts_bson{options_builder.view()};
229230
auto result = libmongoc::database_create_collection(
230-
_get_impl().database_t, name.to_string().c_str(), opts_bson.bson(), &error);
231+
_get_impl().database_t, bsoncxx::string::to_string(name).c_str(), opts_bson.bson(), &error);
231232

232233
if (!result) {
233234
throw_exception<operation_exception>(error);

0 commit comments

Comments
 (0)