#include <tmongoquery.h>
The TMongoQuery class provides a means of operating a MongoDB system.
◆ TMongoQuery() [1/2]
TMongoQuery::TMongoQuery |
( |
const QString & |
collection | ) |
|
Constructs a TMongoQuery object using the collection collection.
◆ TMongoQuery() [2/2]
◆ ~TMongoQuery()
virtual TMongoQuery::~TMongoQuery |
( |
| ) |
|
|
inlinevirtual |
◆ count()
int TMongoQuery::count |
( |
const QVariantMap & |
criteria = QVariantMap() | ) |
|
◆ find()
bool TMongoQuery::find |
( |
const QVariantMap & |
criteria = QVariantMap() , |
|
|
const QVariantMap & |
orderBy = QVariantMap() , |
|
|
const QStringList & |
fields = QStringList() |
|
) |
| |
Finds documents by the criteria criteria in the collection and returns the number of the documents.
Use the fields parameter to control the fields to return.
- See also
- TMongoQuery::next()
◆ findById()
QVariantMap TMongoQuery::findById |
( |
const QString & |
id, |
|
|
const QStringList & |
fields = QStringList() |
|
) |
| |
◆ findOne()
QVariantMap TMongoQuery::findOne |
( |
const QVariantMap & |
criteria = QVariantMap() , |
|
|
const QStringList & |
fields = QStringList() |
|
) |
| |
Finds documents by the criteria criteria in the collection and returns a retrieved document as a QVariantMap object.
Use the fields parameter to control the fields to return.
◆ insert()
bool TMongoQuery::insert |
( |
QVariantMap & |
document | ) |
|
Inserts the document document into the collection.
◆ lastErrorString()
QString TMongoQuery::lastErrorString |
( |
| ) |
const |
Returns the number of documents affected by the result's Mongo statement, or -1 if it cannot be determined.
Returns the string of the most recent error with the current connection.
◆ limit()
int TMongoQuery::limit |
( |
| ) |
const |
|
inline |
◆ next()
bool TMongoQuery::next |
( |
| ) |
|
Retrieves the next document in the result set, if available, and positions on the retrieved document.
Returns true if the record is successfully retrieved; otherwise returns false.
◆ offset()
int TMongoQuery::offset |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ remove()
int TMongoQuery::remove |
( |
const QVariantMap & |
criteria | ) |
|
Removes documents that matches the criteria from the collection.
◆ removeById()
bool TMongoQuery::removeById |
( |
const QVariantMap & |
document | ) |
|
Removes an existing document that matches the ObjectID of the document from the collection.
◆ setLimit()
void TMongoQuery::setLimit |
( |
int |
limit | ) |
|
|
inline |
Sets the limit to limit, which is the limited number of documents for finding documents.
- See also
- TMongoQuery::find()
◆ setOffset()
void TMongoQuery::setOffset |
( |
int |
offset | ) |
|
|
inline |
Sets the offset to offset, which is the number of documents to skip for finding documents.
- See also
- TMongoQuery::find()
◆ update()
int TMongoQuery::update |
( |
const QVariantMap & |
criteria, |
|
|
const QVariantMap & |
document, |
|
|
bool |
upsert = false |
|
) |
| |
Updates an existing document of the selection criteria criteria in the collection with new document document.
When the upsert is true, inserts the document in the collection if no document matches the criteria.
◆ updateById()
bool TMongoQuery::updateById |
( |
const QVariantMap & |
document | ) |
|
Updates an existing document that matches the ObjectID with the document.
◆ updateMany()
int TMongoQuery::updateMany |
( |
const QVariantMap & |
criteria, |
|
|
const QVariantMap & |
document |
|
) |
| |
Updates existing documents of the selection criteria criteria in the collection with new document document.
◆ updateMulti()
int TMongoQuery::updateMulti |
( |
const QVariantMap & |
criteria, |
|
|
const QVariantMap & |
document |
|
) |
| |
|
inline |
◆ value()
QVariantMap TMongoQuery::value |
( |
| ) |
const |
Returns the current document as a QVariantMap object.
◆ TCacheMongoStore
friend class TCacheMongoStore |
|
friend |
The documentation for this class was generated from the following files: