mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	closes #4307
ability to send an array of keys to getSortedSetRange use getSortedSetRevRange instead of getSortedSetRevUnion
This commit is contained in:
		| @@ -125,6 +125,11 @@ module.exports = function(db, module) { | ||||
| 		if (withScores) { | ||||
| 			fields.score = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (Array.isArray(key)) { | ||||
| 			key = {$in: key}; | ||||
| 		} | ||||
|  | ||||
| 		db.collection('objects').find({_key: key}, {fields: fields}) | ||||
| 			.limit(stop - start + 1) | ||||
| 			.skip(start) | ||||
| @@ -459,6 +464,7 @@ module.exports = function(db, module) { | ||||
| 		getSortedSetUnion(sets, -1, start, stop, callback); | ||||
| 	}; | ||||
|  | ||||
|  | ||||
| 	function getSortedSetUnion(sets, sort, start, stop, callback) { | ||||
| 		if (!Array.isArray(sets) || !sets.length) { | ||||
| 			return callback(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user