2 Data manipulations
All functions in this section accepts collection as parameter.
It can be mongo-collection or string that represents name of the collection.
If you will not specify this parameter (current-mongo-collection) value will be used.
Same as
db.collection.save() in the native mongo shell. Look
Queries for
query syntax.
Experimental function. As for now it seems there is no function like "last inserted id".
This function works the same as mongo-save but returns id of the last inserted record.
To achieve this random key with random value inserted in the query -> query sent to database ->
record that contains that random key value is fetched -> id of the record saved and instruction
to modify record in database to remove random key is sent to database.
Maybe there exists easier way to do it so try not to use it straight.
Same as
db.collection.find() in the native mongo shell. Look
Queries for
query syntax.
Returns cursor.
Same as
db.collection.find() in the native mongo shell. Look
Queries for
query syntax. Uses
mongo-find-cursor.
Returns list of hashes as records that match query. If none is found empty list returned.
Same as
db.collection.findOne() in the native mongo shell. Look
Queries for
query syntax.
Retreives cursor with
mongo-find-cursor and fetches first record from it, then kills cursor.
Returns hash represention of record. If none is found result is false.
Same as
db.collection.update() in the native mongo shell. Look
Queries for
query syntax.
Positive
upsert means that object will be inserted in collection if nothing will match
criteria.
If
multi is false update will be applied only at first found object,
either if
multi is true all objects matched
criteria will be updated.
Look
original manual for additional explanations.
Same as db.getCollectionNames() in the native mongo shell. Enumerates collection names in database.
Alias for mongo-getCollectionNames.
Same as "show dbs" in the native mongo shell. Enumerates database names at the server.
Combination of
(hash-ref object 'id) for hash representation of record
and
(cdr (assoc 'id object)) for list representation.
Way to omit writing
(mongo-findOne (list (cons 'id id))).