aheckmann / gridfs-stream

Easily stream files to and from MongoDB
MIT License
615 stars 120 forks source link

find by _id is not working #43

Closed deviant32 closed 10 years ago

deviant32 commented 10 years ago

gfs.files.find({ _id:id}, function(err, file){}) is always returning a null file object even if it exists.

mflorence99 commented 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) { ... });
Reggino commented 10 years ago

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.