aheckmann / gridfs-stream

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

exist and remove causing trouble #97

Open AlexandreRoba opened 8 years ago

AlexandreRoba commented 8 years ago

Hi all,

Im' having difficulties with the following:

var mongo = require('mongodb');
var Grid = require('gridfs-stream');

var db = new mongo.Db('dbtest', new mongo.Server("127.0.0.1", 27017));
var gfs = Grid(db, mongo);
var filename = 'emptyfile.txt';
gfs.exist({filename}, (err, found)=> {
    if (err) {
        throw err;
    }
    console.log('File Exists:' + found);
});

It simply exit whitout any error or log. If I run it in debug it simply hang.

Any idea?

sergiu-gordienco commented 8 years ago

{filename} » {filename: filename}