mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Started on node.js+socket.io+mongoDB on the backend for more responsivnes
This commit is contained in:
31
server/node_modules/mongojs/test/test-runcommand.js
generated
vendored
Executable file
31
server/node_modules/mongojs/test/test-runcommand.js
generated
vendored
Executable file
@@ -0,0 +1,31 @@
|
||||
var insert = require('./insert');
|
||||
|
||||
insert('runCommand', [{
|
||||
hello: "world"
|
||||
},{
|
||||
hello: "world2"
|
||||
},{
|
||||
hello: "world3"
|
||||
},{
|
||||
hello: "world"
|
||||
}], function(db, t, done) {
|
||||
db.runCommand({count: "a", query:{}}, function(err, res) {
|
||||
t.equal(res.n, 4);
|
||||
db.a.runCommand('count', {query: {hello: "world"}}, function(err, res) {
|
||||
t.equal(res.n, 2);
|
||||
db.a.runCommand('distinct', {key: "hello", query:{}}, function(err, docs) {
|
||||
t.equal(docs.values.length, 3);
|
||||
db.runCommand({distinct:'a', key:"hello", query:{hello:"world"}}, function(err, docs) {
|
||||
t.equal(docs.values.length, 1);
|
||||
db.runCommand("ping", function(err, res) {
|
||||
t.equal(res.ok,1);
|
||||
db.a.runCommand("count", function(err, res) {
|
||||
t.equal(res.n, 4);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user