MySQL Connector/C++
MySQL connector library for C and C++ applications
Classes
collection_crud.h File Reference

Declarations for CRUD operations on document collections. More...

Go to the source code of this file.

Classes

class  CollectionAdd
 An operation which adds documents to a collection. More...
 
class  CollectionRemove
 An operation which removes documents from a collection. More...
 
class  CollectionFind
 An operation which returns all or selected documents from a collection. More...
 
class  CollectionModify
 An operation which modifies all or selected documents in a collection. More...
 

Detailed Description

Declarations for CRUD operations on document collections.

Classes declared here represent CRUD operations on a document collection. An Object of a class such as CollectionAdd represents a "yet-to-be-executed" operation and stores all the parameters of the operation. The operation is sent to server for execution only when execute() method is called.

The following classes for collection CRUD operations are defined:

CRUD operation objects can be created directly, or assigned from result of DevAPI methods that create such operations:

CollectionAdd add_op(coll);
CollectionFind find_op = coll.find(...).sort(...);

CRUD operation objects have methods which can modify the operation before it gets executed. For example CollectionAdd::add() appends a document to the list of documents that should be added by the given CollectionAdd operation. These methods can be chained as allowed by the fluent API grammar.