|
There are three ways in which strings are accepted in the public API. Examples:
In src/bsoncxx/document/value.hpp
document::view::const_iterator find(stdx::string_view key) const;
|
In src/mongocxx/client.hpp:
class database database(bsoncxx::string::view_or_value name) const&;
|
In src/mongocxx/client_side_encryption.hpp
bsoncxx::types::bson_value::value create_data_key(std::string kms_provider,
|
const options::data_key& opts = {});
|
We should be consistent based on whether the callee needs to retain a copy of the argument. The rule may be: accept a string_view when the callee does not to copy, and use a bsoncxx::string::view_or_value if the callee does need to retain a copy.
|