mongoose-random icon indicating copy to clipboard operation
mongoose-random copied to clipboard

TypeError: <collection>.findRandom is not a function

Open saemirii opened this issue 3 years ago • 0 comments

                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.

saemirii avatar Nov 30 '22 14:11 saemirii