From e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d Mon Sep 17 00:00:00 2001 From: Piotr Russ Date: Mon, 16 Nov 2020 00:10:28 +0100 Subject: api, login, auth --- node_modules/mquery/test/collection/node.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 node_modules/mquery/test/collection/node.js (limited to 'node_modules/mquery/test/collection/node.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); + }); +}; -- cgit v1.2.3