mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	fix: #5570, create per category user post zsets
This commit is contained in:
		| @@ -162,6 +162,17 @@ module.exports = function (db, module) { | ||||
| 		async.map(keys, module.sortedSetCard, callback); | ||||
| 	}; | ||||
|  | ||||
| 	module.sortedSetsCardSum = function (keys, callback) { | ||||
| 		if (!keys || (Array.isArray(keys) && !keys.length)) { | ||||
| 			return callback(null, 0); | ||||
| 		} | ||||
|  | ||||
| 		db.collection('objects').countDocuments({ _key: Array.isArray(keys) ? { $in: keys } : keys }, function (err, count) { | ||||
| 			count = parseInt(count, 10); | ||||
| 			callback(err, count || 0); | ||||
| 		}); | ||||
| 	}; | ||||
|  | ||||
| 	module.sortedSetRank = function (key, value, callback) { | ||||
| 		getSortedSetRank(false, key, value, callback); | ||||
| 	}; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user