MySQL Connector/C++
MySQL connector library for C and C++ applications
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CollectionFind Class Reference

An operation which returns all or selected documents from a collection. More...

Public Member Functions

 CollectionFind (Collection &coll)
 Create an operation which returns all documents from the given collection.
 
 CollectionFind (Collection &coll, const string &expr)
 Create an operation which returns selected documents from the given collection.
 
template<typename... Expr>
Operation & fields (Expr... proj)
 Specify a projection for the documents returned by this operation.
 
Operation & groupBy (Expr... group_by_spec)
 Specify grouping of items in a query result.
 
Operation & having (const string &having_spec)
 Specify filter over grouped results of a query.
 
Operation & sort (Type... spec)
 Specify ordering of documents in a query results.
 
Operation & limit (unsigned items)
 Limit the operation to the given number of items (rows or documents).
 
Operation & offset (unsigned rows)
 Skip the given number of items (rows or documents) before starting to perform the operation.
 
BindOperationbind (const string &parameter, const Value &val)
 Bind parameter with given name to the given value.
 
Operation & bind (const Map &args)
 Bind parameters to values given by a map from parameter names to their values.
 
Operation & lockShared (LockContention contention=LockContention::DEFAULT)
 Set a shared mode lock on any rows/documents that are read.
 
Operation & lockExclusive (LockContention contention=LockContention::DEFAULT)
 Set an exclusive mode lock on any rows/documents that are read.
 
virtual DocResult execute ()
 Execute given operation and return its result.
 
virtual DocResult execute ()
 Execute given operation and return its result.
 
virtual DocResult execute ()
 Execute given operation and return its result.
 

Detailed Description

An operation which returns all or selected documents from a collection.

Constructor & Destructor Documentation

◆ CollectionFind()

CollectionFind ( Collection coll,
const string expr 
)
inline

Create an operation which returns selected documents from the given collection.

Documents to be returned are specified by the given Boolean expression.

Member Function Documentation

◆ fields()

Operation & fields ( Expr...  proj)
inline

Specify a projection for the documents returned by this operation.

Projection is either a single document expression given by expr(<string>) or a list (or collection) of strings of the form "<expression> AS <path>". In the latter case each <expression> is evaluated and <path> specifies where to put the value of the expression in the resulting document (see CollectionModify for more information about document paths).

◆ groupBy()

Operation & groupBy ( Expr...  group_by_spec)
inlineinherited

Specify grouping of items in a query result.

Arguments are a one or more expressions. Documents/rows for which expressions evaluate to the same value are grouped together.

◆ having()

Operation & having ( const string having_spec)
inlineinherited

Specify filter over grouped results of a query.

The argument is a Boolean expression which can use aggregation functions.

◆ sort()

Operation & sort ( Type...  spec)
inlineinherited

Specify ordering of documents in a query results.

Arguments are one or more strings of the form "<expr> <dir>" where <expr> gives the value to sort on and <dir> is a sorting direction ASC or DESC.

◆ bind()

BindOperation & bind ( const string parameter,
const Value val 
)
inlineinherited

Bind parameter with given name to the given value.

A statement or query can be executed only if all named parameters used by it are bound to values.

◆ lockShared()

Operation & lockShared ( LockContention  contention = LockContention::DEFAULT)
inlineinherited

Set a shared mode lock on any rows/documents that are read.

Other sessions can read, but not modify locked rows/documents.

◆ lockExclusive()

Operation & lockExclusive ( LockContention  contention = LockContention::DEFAULT)
inlineinherited

Set an exclusive mode lock on any rows/documents that are read.

Other sessions are blocked from modifying, locking, or reading the data in certain transaction isolation levels. The lock is released when the transaction is committed or rolled back.


The documentation for this class was generated from the following file: