summary refs log tree commit diff stats
path: root/tests/compile
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-04-09 11:18:10 +0200
committerAraq <rumpf_a@web.de>2012-04-09 11:18:10 +0200
commitc53ad1b39fdd977b03b9cc2560b351ad6df4bfdd (patch)
tree064a972f7ee71f19302ecf509756076441d3d442 /tests/compile
parente9260e6c4d332d3f3f27997d0985a3881745cc56 (diff)
downloadNim-c53ad1b39fdd977b03b9cc2560b351ad6df4bfdd.tar.gz
documentation improvements; higher level Mongodb wrapper
Diffstat (limited to 'tests/compile')
-rw-r--r--tests/compile/tmongo.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/compile/tmongo.nim b/tests/compile/tmongo.nim
new file mode 100644
index 000000000..1c4c0f4e6
--- /dev/null
+++ b/tests/compile/tmongo.nim
@@ -0,0 +1,16 @@
+
+import mongo, db_mongo, oids, json
+
+var conn = db_mongo.open()
+
+var data = %{"a": %13, "b": %"my string value", 
+             "inner": %{"i": %71} }
+
+var id = insertID(conn, "test.test", data)
+
+for v in find(conn, "test.test", "this.a == 13"):
+  print v
+
+delete(conn, "test.test", id)
+
+close(conn)