marcello3d / node-mongolian

[project inactive] Mongolian DeadBeef is an awesome Mongo DB driver for node.js
https://groups.google.com/group/node-mongolian
zlib License
350 stars 50 forks source link

Error if save has no callback parameter. #53

Closed hdf closed 13 years ago

hdf commented 13 years ago

I generally don't give a callback for collection.save(), but recently this started throwing an error. This seems to fix it.

marcello3d commented 13 years ago

This kind of feels like a band-aid. What is the error/stack trace you're getting?

hdf commented 13 years ago
C:\node_modules\mongolian\lib\collection.js:123
            callback(null, object)
            ^
TypeError: undefined is not a function
    at C:\node_modules\mongolian\lib\collection.js:123:13
    at C:\node_modules\mongolian\lib\util.js:19:18
    at C:\node_modules\mongolian\lib\collection.js:98:13
    at C:\node_modules\mongolian\lib\util.js:19:18
    at C:\node_modules\mongolian\lib\db.js:69:25
    at C:\node_modules\mongolian\lib\util.js:19:18
    at [object Object].next (C:\node_modules\mongolian\lib\cursor.js:159:9)
    at C:\node_modules\mongolian\lib\cursor.js:163:18
    at C:\node_modules\mongolian\lib\util.js:19:18
    at C:\node_modules\mongolian\lib\cursor.js:117:9
marcello3d commented 13 years ago

Great, thanks. I tracked down the problem, it's a regression from an earlier fix. Posting a fix and test case shortly...