mongodb -
MongoDB Nit Driver.
This is actually a wrapper around the MongoDB C Driver.
Usage:
var client = new MongoClient("mongodb://mongo:27017/")
# Select the database.
var db_suffix = "NIT_TESTING_ID".environ
var db_name = "test_{db_suffix}"
var db = client.database(db_name)
# Retrieve a collection.
var col = db.collection("test")
# Insert a document in the collection.
var doc = new JsonObject
doc["foo"] = 10
doc["bar"] = "bar"
doc["baz"] = new JsonArray
assert col.insert(doc)
# Retrieve a document from the collection.
var query = new JsonObject
query["foo"] = 10
var res = col.find(query)
assert res["bar"] == "bar"
Content
- mongodb (lib/mongodb)
- mongodb: MongoDB Nit Driver. (lib/mongodb/mongodb.nit)
- native_mongodb: Native wrapper for the MongoDB C Driver (lib/mongodb/native_mongodb.nit)
- queries: Mongo queries framework (lib/mongodb/queries.nit)