mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
tons of fixes to mongo and redis, to make returns the same
This commit is contained in:
@@ -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);
|
||||
})
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user