-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Cursor.nextObject because it was removed from node-mongodb-native library #125
Comments
I am experiencing the same issue right now after updating to mongoose 5. Running MongoDB 3.6.3 and gridfs-stream 1.1.1.
|
You could monkey patch it until its fixed (with evil eval 😉): const Grid = require('gridfs-stream');
eval(`Grid.prototype.findOne = ${Grid.prototype.findOne.toString().replace('nextObject', 'next')}`); |
Another option is to change in the source at Grid.prototype.findOne:
to:
This way you will don't need remember to update your code. I think. =) |
Can confirm! This is still happening! Wendellpereira has the right answer to this issue. Fixed by changing |
#133 will help |
Made to fix issue similar to this one: aheckmann/gridfs-stream#125
Needed to fix this issue: aheckmann/gridfs-stream#125 TLDR: breaking change in node-mongodb-native package prevent from using new mongo version
Needed to fix this issue: aheckmann/gridfs-stream#125 TLDR: breaking change in node-mongodb-native package prevent from using new mongo version
Fixing this issue aheckmann#125
Is it possible fix the package for not use monkey patch. |
cursor.next is not a function is the new error i am getting after changing nextObject to next |
Has this been resolved ? |
@traoremp from what I see this project is no longer maintained. |
Cursor.nextObject was deprecated since version 2 of the node-mongodb-native library and was now removed completely from the library.
Because gridfs-stream uses Cursor.nextObject it is not compatible any more with the new version which is used from mongoose 5 now.
Cursor.nextObject must be replaced by Cursor.next
https://github.com/mongodb/node-mongodb-native/blob/3.0.0/CHANGES_3.0.0.md
mongodb/node-mongodb-native#1527
The text was updated successfully, but these errors were encountered: