summaryrefslogtreecommitdiffstats
path: root/node_modules/mquery/test/collection
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/mquery/test/collection')
-rw-r--r--node_modules/mquery/test/collection/browser.js0
-rw-r--r--node_modules/mquery/test/collection/mongo.js0
-rw-r--r--node_modules/mquery/test/collection/node.js28
3 files changed, 28 insertions, 0 deletions
diff --git a/node_modules/mquery/test/collection/browser.js b/node_modules/mquery/test/collection/browser.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/node_modules/mquery/test/collection/browser.js
diff --git a/node_modules/mquery/test/collection/mongo.js b/node_modules/mquery/test/collection/mongo.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/node_modules/mquery/test/collection/mongo.js
diff --git a/node_modules/mquery/test/collection/node.js b/node_modules/mquery/test/collection/node.js
new file mode 100644
index 0000000..8ac380b
--- /dev/null
+++ b/node_modules/mquery/test/collection/node.js
@@ -0,0 +1,28 @@
+
+var assert = require('assert');
+var mongo = require('mongodb');
+
+var uri = process.env.MQUERY_URI || 'mongodb://localhost/mquery';
+var client;
+var db;
+
+exports.getCollection = function(cb) {
+ mongo.MongoClient.connect(uri, function(err, _client) {
+ assert.ifError(err);
+ client = _client;
+ db = client.db();
+
+ var collection = db.collection('stuff');
+
+ // clean test db before starting
+ db.dropDatabase(function() {
+ cb(null, collection);
+ });
+ });
+};
+
+exports.dropCollection = function(cb) {
+ db.dropDatabase(function() {
+ client.close(cb);
+ });
+};