tons of fixes to mongo and redis, to make returns the same

This commit is contained in:
Baris Soner Usakli
2013-12-05 18:26:26 -05:00
parent dcbe4ffd4a
commit 1564e3d530
4 changed files with 92 additions and 23 deletions

View File

@@ -92,8 +92,14 @@ var DebugRoute = function(app) {
});
app.get('/mongo', function(req, res) {
var dbtype = 'mongo';
if(req.query.db) {
dbtype = req.query.db;
}
var db = require('./../database/' + dbtype);
var db = require('./../database');
var objectKey = 'testing4';
function createUser(callback) {
@@ -208,6 +214,20 @@ var DebugRoute = function(app) {
});
}
function sortedSetScore(callback) {
db.sortedSetScore('users:joindate', 1, function(err, data) {
console.log('sortedSetScore return', data);
callback(err, {'sortedSetScore': data});
});
}
function sortedSetsScore(callback) {
db.sortedSetsScore(['users:joindate', 'users:derp', 'users:postcount'], 1, function(err, data) {
console.log('sortedSetsScore return', data);
callback(err, {'sortedSetsScore': data});
});
}
function listAppend(callback) {
db.listAppend('myList5', 5, function(err, data) {
console.log('listAppend return', data);
@@ -345,7 +365,9 @@ var DebugRoute = function(app) {
getSortedSetRange,
//sortedSetRemove,
getSortedSetRange,
sortedSetCount
sortedSetCount,
sortedSetScore,
sortedSetsScore
];
var listTasks = [
@@ -385,10 +407,9 @@ var DebugRoute = function(app) {
var miscTests = [
function(next) {
db.isObjectField('email:uid', 'barisusakli@gmail.com', function(err, exists) {
console.log(err, exists);
next(err, exists);
});
db.sortedSetScore('users:joindate', 1, function(err, result) {
next(err, result);
})
}
];