Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 28 lines (24 sloc) 0.65 kB
3df070a @TheHippo build & test files added
authored
1
2 class Test {
3
4 public static function main() {
cb50027 @TheHippo removed bogus code, fixed compiler flags for linking
authored
5 var c = nMongo.DBConnection.connect('localhost');
aa69900 @TheHippo some struggles with c++
authored
6 trace(c.getServerAddress());
506514d @TheHippo added get databases call
authored
7 trace(c.getDatabaseNames());
854a51a @TheHippo able to insert
authored
8 var data = new nMongo.BSON({
5e5c3a3 @TheHippo bson encoding
authored
9 foo:"bar",
10 bar:[1,2,3],
11 date:Date.now().getTime(),
12 obj: {
13 bar:"foo",
14 foo:["a","b","c"]
15 }
16 });
17 trace(data.json());
4ce4857 @TheHippo started decoding
authored
18 trace(data.decode());
854a51a @TheHippo able to insert
authored
19 trace(c.test.test.count());
20 c.foo.foo.insert(data);
1e5e0de @TheHippo able to perform simple queries
authored
21 var cur = c.foo.foo.query(new nMongo.Query().limit(5).where("foo","bar"));
22 for (i in cur)
23 trace(i.json());
24
25 //trace(nMongo.DBConnection.connect("localhost").foo.foo.query(new nMongo.Query().limit(1).where("foo","bar")));
3df070a @TheHippo build & test files added
authored
26 }
27 }
Something went wrong with that request. Please try again.