Skip to content

Commit 4b49bc7

Browse files
committed
doc comments
1 parent 22c6856 commit 4b49bc7

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

src/mongocxx/collection.hpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,23 @@ class MONGOCXX_API collection {
722722
void drop(const client_session& session,
723723
const bsoncxx::stdx::optional<mongocxx::write_concern>& write_concern = {});
724724

725+
///
726+
/// Drops this collection and all its contained documents from the database.
727+
///
728+
/// @param collection_options
729+
/// the options for the dropped collection.
730+
///
731+
/// @exception
732+
/// mongocxx::operation_exception if the operation fails.
733+
///
734+
/// @see
735+
/// https://docs.mongodb.com/manual/reference/command/drop/
736+
///
737+
/// @note
738+
/// Needed for FLE 2 Support.
739+
///
725740
void drop(bsoncxx::document::view_or_value collection_options);
741+
726742
///
727743
/// @}
728744
///

src/mongocxx/options/auto_encryption.hpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,17 @@ class MONGOCXX_API auto_encryption {
238238
const stdx::optional<bsoncxx::document::view_or_value>& schema_map() const;
239239

240240
///
241-
/// TODO
241+
/// Sets the local encrypted fields map.
242+
///
243+
/// Supplying an encryptedFieldsMap provides more security than relying on
244+
/// an encryptedFields obtained from the server. It protects against a
245+
/// malicious server advertising a false encryptedFields.
246+
///
242247
/// @param encrypted_fields_map
248+
/// The mapping of which fields to encrypt.
249+
///
250+
/// @see https://docs.mongodb.com/manual/core/security-client-side-encryption/
251+
///
243252
/// @return
244253
/// A reference to this object to facilitate method chaining.
245254
///
@@ -252,6 +261,7 @@ class MONGOCXX_API auto_encryption {
252261
///
253262
/// @return
254263
/// An optional document containing the encrypted fields map
264+
///
255265
const stdx::optional<bsoncxx::document::view_or_value>& encrypted_fields_map() const;
256266

257267
///

src/mongocxx/test/spec/operation.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,14 +1283,12 @@ document::value operation_runner::_run_create_collection(document::view operatio
12831283
auto collection_name = arguments["collection"].get_string().value;
12841284
auto session = _lookup_session(arguments);
12851285

1286-
std::cerr << "CREATE COLLECTION: " << bsoncxx::to_json(operation) << std::endl;
12871286
if (session) {
12881287
_db->create_collection(*session, collection_name);
12891288
} else if (arguments.find("encryptedFields") != arguments.end()) {
12901289
auto encrypted_fields = arguments["encryptedFields"].get_document().value;
12911290
auto encrypted_fields_map = make_document(kvp("encryptedFields", encrypted_fields));
12921291
_db->create_collection(collection_name, std::move(encrypted_fields_map));
1293-
std::cerr << "CREATED COLLECTION WITH ENCRYPTED FIELDS" << std::endl;
12941292
} else {
12951293
_db->create_collection(collection_name);
12961294
}
@@ -1305,14 +1303,12 @@ document::value operation_runner::_run_drop_collection(document::view operation)
13051303

13061304
auto arguments = operation["arguments"].get_document().value;
13071305

1308-
std::cerr << "DROP COLLECTION: " << bsoncxx::to_json(operation) << std::endl;
13091306
auto collection_name = operation["arguments"]["collection"].get_string().value;
13101307

13111308
if (arguments.find("encryptedFields") != arguments.end()) {
13121309
auto encrypted_fields = arguments["encryptedFields"].get_document().value;
13131310
auto encrypted_fields_map = make_document(kvp("encryptedFields", encrypted_fields));
13141311
_db->collection(collection_name).drop(std::move(encrypted_fields_map));
1315-
std::cerr << "CREATED COLLECTION WITH ENCRYPTED FIELDS" << std::endl;
13161312
} else {
13171313
_db->collection(collection_name).drop();
13181314
}

0 commit comments

Comments
 (0)