Dan mungkin solusinya ada di sini - lihat komentar di npm halaman mongoose-random contoh .
// if you have an existing collection, it must first by synced.
// this will add random data for the `path` key for each doc.
Coba
productSchema.syncRandom(function (err, result) {
console.log(result.updated);
});