mongoose-random
mongoose-random copied to clipboard
TypeError: <collection>.findRandom is not a function
const rand = flashcard.findRandom().limit(1).exec(function (err, flashcard) {
console.log(flashcard);
});
This is how I am using the .findRandom() function, but I get an error stating that it's not a function. Not sure where I went wrong.