Trying to get random cursor from collection - Error: Publish function can only return a Cursor or an array of Cursors
问题 I am trying to publish a random question from a collection of questions. However I get an error stating: Error: Publish function can only return a Cursor or an array of Cursors. How do I change my publication below so this outputs one random question? Publications.js Meteor.publish('randomQuestions', function(){ var randomInRange = function(min, max) { var random = Math.floor(Math.random() * (max - min + 1)) + min; return random; }; var q = Questions.find().fetch(); var count = q.length; var