Interface MongoDB
access this type via: data.mongo.MongoDB (provides, requires or uses)
MongoDB database driver.
Functions
MongoDB(char ip[], int port)
bool insert(char collection[], JSONElement jsonQuery[])
JSONElement[] find(char collection[], JSONElement jsonQuery, int4 numberToReturn)
JSONElement[] findWithModifier(char collection[], JSONElement jsonQuery, JSONElement modifier, int4 numberToReturn)
bool update(char collection[], JSONElement jsonQuery, JSONElement update)
bool delete(char collection[], JSONElement jsonQuery)
MongoDB(char ip[], int port)
Create a new MongoDB connection on the given IP address and port.
bool insert(char collection[], JSONElement jsonQuery[])
Insert a record. If you insert into a collection that does not exist, it will be created.
collection The name of the database and collection that is the target of the insert, formatted as ''database.collection''.
JSONElement[] find(char collection[], JSONElement jsonQuery, int4 numberToReturn)
Find an element in a collection.
collection The name of the database and collection that is the target of the find operation, formatted as ''database.collection''.
jsonQuery The JSON query to execute on the database.
numberToReturn The maximum number of documents to return. Set to zero to use the default.
JSONElement[] findWithModifier(char collection[], JSONElement jsonQuery, JSONElement modifier, int4 numberToReturn)
Find an element in a collection, using a modifier.
collection The name of the database and collection that is the target of the find operation, formatted as ''database.collection''.
jsonQuery The JSON query to execute on the database.
modifier A JSON object containing the set of modifiers, such as ordering predicates. For a full list of modifiers, see http://docs.mongodb.org/manual/reference/operator/query-modifier/.
numberToReturn The maximum number of documents to return. Set to zero to use the default.
bool update(char collection[], JSONElement jsonQuery, JSONElement update)
Update an element in a collection.
collection The name of the database and collection that is the target of the update operation, formatted as ''database.collection''.
jsonQuery The JSON query to execute on the database.
update The updated version of the record.
bool delete(char collection[], JSONElement jsonQuery)
Delete an element from a collection.
collection The name of the database and collection that is the target of the delete operation, formatted as ''database.collection''.
jsonQuery The JSON query to execute on the database.