Closed deviant32 closed 10 years ago
IMHO the example is wrong. I resorted to this (where data
is my root):
db.collection("data.files").find( { _id: _id } ).toArray(function(err, files) { ... });
This library is about streaming files, not about file handling in general through gridfs.
Please see https://github.com/mongodb/node-mongodb-native/ if you experience any issues with general gridfs usage.
gfs.files.find({ _id:id}, function(err, file){}) is always returning a null file object even if it exists.