问题
How do you put the close() in the writeBuffer callback?
This question relates to: Problem with MongoDB GridFS Saving Files with Node.JS
回答1:
A simple example is
https://github.com/mongodb/node-mongodb-native/blob/master/test/gridstore/grid_store_test.js#L97
Also check the docs for changes in behavior, writeBuffer was removed so just use write.
http://mongodb.github.com/node-mongodb-native/
来源:https://stackoverflow.com/questions/10092282/saving-files-to-mongodb-gridfs-with-node-js