Closed nikmartin closed 10 years ago
Hi,
Same issue here, but I've found a solution. (I use mongoose)
grid.files.findOne({ "_id" : "52f0af98e47dd6300334d009"}, function (err, file) {
console.log(err); //Nothing
console.log(file); //Nothing
});
var ObjectID = mongoose.mongo.BSONPure.ObjectID; //First, get ObjectID
grid.files.findOne({ "_id" : ObjectID("52f0af98e47dd6300334d009")}, function (err, file) {
console.log(err); //Nothing
console.log(file); //My file
});
Have a nice day
Trying to query files collection for metadata, using an _id that exists:
Both err and file are null. Can the fs.files collection be queried by _id?