|
TreeFrogFramework 2.10
|
#include <tmongoquery.h>

Public Member Functions | |
| TMongoQuery (const QString &collection) | |
| TMongoQuery (const TMongoQuery &other) | |
| virtual | ~TMongoQuery () |
| int | limit () const |
| void | setLimit (int limit) |
| int | offset () const |
| void | setOffset (int offset) |
| bool | find (const QVariantMap &criteria=QVariantMap(), const QVariantMap &orderBy=QVariantMap(), const QStringList &fields=QStringList()) |
| bool | next () |
| QVariantMap | value () const |
| QVariantMap | findOne (const QVariantMap &criteria=QVariantMap(), const QStringList &fields=QStringList()) |
| QVariantMap | findById (const QString &id, const QStringList &fields=QStringList()) |
| bool | insert (QVariantMap &document) |
| int | update (const QVariantMap &criteria, const QVariantMap &document, bool upsert=false) |
| bool | updateById (const QVariantMap &document) |
| int | updateMany (const QVariantMap &criteria, const QVariantMap &document) |
| int | updateMulti (const QVariantMap &criteria, const QVariantMap &document) |
| int | remove (const QVariantMap &criteria) |
| bool | removeById (const QVariantMap &document) |
| int | count (const QVariantMap &criteria=QVariantMap()) |
| QString | lastErrorString () const |
| TMongoQuery & | operator= (const TMongoQuery &other) |
Friends | |
| class | TCacheMongoStore |
The TMongoQuery class provides a means of operating a MongoDB system.
| TMongoQuery::TMongoQuery | ( | const QString & | collection | ) |
Constructs a TMongoQuery object using the collection collection.
| TMongoQuery::TMongoQuery | ( | const TMongoQuery & | other | ) |
Copy constructor.
|
inlinevirtual |
| int TMongoQuery::count | ( | const QVariantMap & | criteria = QVariantMap() | ) |
| 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.
| QVariantMap TMongoQuery::findById | ( | const QString & | id, |
| const QStringList & | fields = QStringList() |
||
| ) |
| 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.
| bool TMongoQuery::insert | ( | QVariantMap & | document | ) |
Inserts the document document into the collection.
| 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.
|
inline |
| 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.
|
inline |
| TMongoQuery & TMongoQuery::operator= | ( | const TMongoQuery & | other | ) |
Assignment operator.
| int TMongoQuery::remove | ( | const QVariantMap & | criteria | ) |
Removes documents that matches the criteria from the collection.
| bool TMongoQuery::removeById | ( | const QVariantMap & | document | ) |
Removes an existing document that matches the ObjectID of the document from the collection.
|
inline |
Sets the limit to limit, which is the limited number of documents for finding documents.
|
inline |
Sets the offset to offset, which is the number of documents to skip for finding documents.
| 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.
| bool TMongoQuery::updateById | ( | const QVariantMap & | document | ) |
Updates an existing document that matches the ObjectID with the document.
| int TMongoQuery::updateMany | ( | const QVariantMap & | criteria, |
| const QVariantMap & | document | ||
| ) |
Updates existing documents of the selection criteria criteria in the collection with new document document.
|
inline |
| QVariantMap TMongoQuery::value | ( | ) | const |
Returns the current document as a QVariantMap object.
|
friend |