Reputation: 21
How can I do a random search in Mongodb and Meteor.js, so that the results do not always go in the same order?
Upvotes: 1
Views: 63
Reputation: 4017
You can use lodash shuffle like:
_.shuffle(CollectionName.find().fetch())
Upvotes: 1