MySQL Connector/C++
MySQL connector library for C and C++ applications
|
An operation which adds documents to a collection. More...
Public Member Functions | |
CollectionAdd (Collection &coll) | |
Create an empty add operation for the given collection. | |
template<typename It > | |
CollectionAdd & | add (const It &begin, const It &end) |
Add all documents from a range defined by two iterators. | |
template<class Container > | |
CollectionAdd & | add (const Container &c) |
Add all documents within given container. More... | |
template<typename... Types> | |
CollectionAdd & | add (const Types &... docs) |
Add document(s) to a collection. More... | |
virtual Result | execute () |
Execute given operation and return its result. | |
virtual Result | execute () |
Execute given operation and return its result. | |
virtual Result | execute () |
Execute given operation and return its result. | |
An operation which adds documents to a collection.
Documents to be added by this operation are specified with various variants of add()
method.
Each document must have a unique identifier which is stored in _id
field of the document. Document identifiers are character strings no longer than 32 characters. If added document does not have _id
field, a unique identifier is generated for it. Document identifier generated by a given collection add operation can be examined using Result::getDocumentIds()
method. Generated document identifiers are strings of 32 hexadecimal digits, like this one 0512020981044082E6119DFA0E4C0584
.
|
inline |
Add all documents within given container.
Any container type for which std::begin()
/std::end()
are defined should work.
|
inline |
Add document(s) to a collection.
Documents can be described by JSON strings or DbDoc objects.