|
mongocxx::collection | collection () |
| Returns a copy of the underlying collection. More...
|
|
template<class Result = T> |
deserializing_cursor< Result > | aggregate (const mongocxx::pipeline &pipeline, const mongocxx::options::aggregate &options=mongocxx::options::aggregate()) |
| Runs an aggregation framework pipeline against this collection, and returns the results as de-serialized objects. More...
|
|
deserializing_cursor< T > | find (bsoncxx::document::view_or_value filter, const mongocxx::options::find &options=mongocxx::options::find()) |
| Finds the documents in this collection which match the provided filter. More...
|
|
mongocxx::stdx::optional< T > | find_one (bsoncxx::document::view_or_value filter, const mongocxx::options::find &options=mongocxx::options::find()) |
| Finds a single document in this collection that match the provided filter. More...
|
|
mongocxx::stdx::optional< T > | find_one_and_delete (bsoncxx::document::view_or_value filter, const mongocxx::options::find_one_and_delete &options=mongocxx::options::find_one_and_delete()) |
| Finds a single document matching the filter, deletes it, and returns the original as a deserialized object. More...
|
|
mongocxx::stdx::optional< T > | find_one_and_replace (bsoncxx::document::view_or_value filter, const T &replacement, const mongocxx::options::find_one_and_replace &options=mongocxx::options::find_one_and_replace()) |
| Finds a single document matching the filter, replaces it, and returns either the original or the replacement document as a deserialized object. More...
|
|
mongocxx::stdx::optional< mongocxx::result::insert_one > | insert_one (T obj, const mongocxx::options::insert &options=mongocxx::options::insert()) |
| Inserts a single serializable object into the collection. More...
|
|
template<typename container_type > |
mongocxx::stdx::optional< mongocxx::result::insert_many > | insert_many (const container_type &container, const mongocxx::options::insert &options=mongocxx::options::insert()) |
| Inserts multiple serializable objects into the collection. More...
|
|
template<typename object_iterator_type > |
mongocxx::stdx::optional< mongocxx::result::insert_many > | insert_many (object_iterator_type begin, object_iterator_type end, const mongocxx::options::insert &options=mongocxx::options::insert()) |
| Inserts multiple serializable objects into the collection. More...
|
|
mongocxx::stdx::optional< mongocxx::result::replace_one > | replace_one (bsoncxx::document::view_or_value filter, const T &replacement, const mongocxx::options::update &options=mongocxx::options::update()) |
| Replaces a single document matching the provided filter in this collection. More...
|
|
template<class T>
template<typename object_iterator_type >
mongocxx::stdx::optional<mongocxx::result::insert_many> mangrove::collection_wrapper< T >::insert_many |
( |
object_iterator_type |
begin, |
|
|
object_iterator_type |
end, |
|
|
const mongocxx::options::insert & |
options = mongocxx::options::insert() |
|
) |
| |
|
inline |
Inserts multiple serializable objects into the collection.
TODO how to deal w/ identifiers If any of the documents are missing /// identifiers the driver will generate them.
- Warning
- This method uses the bulk insert command to execute the insertion as opposed to the legacy OP_INSERT wire protocol message. As a result, using this method to insert many documents on MongoDB < 2.6 will be slow.
- Template Parameters
-
object_iterator_type | The iterator type. Must meet the requirements for the input iterator concept with a value type that is a serializable object. |
- Parameters
-
begin | Iterator pointing to the first document to be inserted. |
end | Iterator pointing to the end of the documents to be inserted. |
options | Optional arguments, see mongocxx::options::insert. |
- Returns
- The result of attempting to performing the insert.
- Exceptions
-
mongocxx::exception::write | if the operation fails. |
TODO: document DocumentViewIterator concept or static assert