|
@@ -1,6 +1,5 @@
|
|
|
var sql = require('sql-ringojs-client');
|
|
|
var mustache = require('ringo/mustache');
|
|
|
-var mongodb = require('ringo-mongodb');
|
|
|
|
|
|
// DO NOT TOUCH THE FOLLOWING LINE.
|
|
|
// THIS VARIABLE IS REGEX REPLACED BY setup.py
|
|
@@ -80,21 +79,6 @@ exports.app = function(req) {
|
|
|
connection.close();
|
|
|
}
|
|
|
}
|
|
|
- } else if (path === '/mongodb') {
|
|
|
- var queryCount = req.env.servletRequest.getParameter('queries') | 1;
|
|
|
- var col = mongodb.connect(mongodbUri).getCollection('world');
|
|
|
- var body = [];
|
|
|
- var randId, world;
|
|
|
- for (var i = 0; i < queryCount; i++) {
|
|
|
- randId = ((Math.random() * 10000) | 0) + 1;
|
|
|
- world = col.findOne({id: randId});
|
|
|
- body.push(world ? world.data : "Record not found for id#" + randId);
|
|
|
- }
|
|
|
- return {
|
|
|
- status: 200,
|
|
|
- headers: {"Content-Type": "application/json; charset=UTF-8"},
|
|
|
- body: [mongodb.JSON.to(body)]
|
|
|
- };
|
|
|
}
|
|
|
};
|
|
|
|