summary refs log tree commit diff stats
path: root/tests/compile/tmongo.nim
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/tmongo.nim
parente9260e6c4d332d3f3f27997d0985a3881745cc56 (diff)
downloadNim-c53ad1b39fdd977b03b9cc2560b351ad6df4bfdd.tar.gz
documentation improvements; higher level Mongodb wrapper
Diffstat (limited to 'tests/compile/tmongo.nim')
-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)
82b022ebc ^






61f2f1f5c ^

1a47fc229 ^
61f2f1f5c ^








1a47fc229 ^




61f2f1f5c ^

5e8ac485a ^

61f2f1f5c ^



61f2f1f5c ^
















1a47fc229 ^
61f2f1f5c ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125