You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The .cursor() method on mongoose model methods returns a readable stream, not a promise. Given how stream-oriented node js, and how you can easilly .pipe your mongoose queries to your server response like so:
const Model = mongoose.model('model', mySchema);
// ...
Model.find().limit(10).cursor().pipe(res);
It would be nice to have a stub method that returned a readable stream like so
The .cursor() method on mongoose model methods returns a readable stream, not a promise. Given how stream-oriented node js, and how you can easilly .pipe your mongoose queries to your server response like so:
It would be nice to have a stub method that returned a readable stream like so
For now, the only way I can do this is to create a custom readable stream that the mock returns like so.
The text was updated successfully, but these errors were encountered: