aheckmann / gridfs-stream

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

Does not support .then functions #146

Open jelordreygulle opened 4 years ago

jelordreygulle commented 4 years ago

I wanted to use promise in querying file using grid fs .

works

 gfs.findOne({ _id: '54da7b013706c1e7ab25f9fa'}, function (err, file) {
    console.log(file);
  });

does not work using promise

 gfs.findOne({ _id: '54da7b013706c1e7ab25f9fa'}).then(function (file) {
        console.log(file);
      }).catch(function (err) {

    })