Description Details See Also Examples
Objects of class "mongo" are used to connect to a MongoDB server and to perform database operations on that server.
mongo objects have "mongo" as their class and contain an externally managed pointer to the connection data. This pointer is stored in the "mongo" attribute of the object.
Note that the members of the mongo object only reflect
the initial
parameters of mongo.create()
. Only the external data actually
changes if, for example, mongo.timeout is called after the initial call to
mongo.create
.
mongo.create
,
mongo.is.connected
,
mongo.get.databases
,
mongo.get.database.collections
,
mongo.insert
,
mongo.find.one
,
mongo.find
,
mongo.update
,
mongo.remove
,
mongo.drop
,
mongo.drop.database
mongo.gridfs.
1 2 3 4 5 6 7 8 | mongo <- mongo.create()
if (mongo.is.connected(mongo)) {
buf <- mongo.bson.buffer.create()
mongo.bson.buffer.append(buf, "name", "Joe")
mongo.bson.buffer.append(buf, "age", 22L)
b <- mongo.bson.from.buffer(buf)
mongo.insert(mongo, "test.people", b)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.