Meteor-CollectionFS
Meteor-CollectionFS copied to clipboard
displaying an image: findOne returns undefined
Hi, I am trying to find an image but keep getting undefined as a result of a findOne().
The FS:Collection on the client:
var registrationImageStorage = new FS.Store.Dropbox("registrationStorage");
RegistrationImages = new FS.Collection("registrations", {
stores: [registrationImageStorage],
filter: {
allow: {
contentTypes: ['image/*']
}
}
});
The client code to get the image file:
console.log(RegistrationImages.find().fetch());
console.log(RegistrationImages.findOne({ _id: self.profile.badge }));
self.profile.badge = RegistrationImages.findOne({ _id: self.profile.badge });
These logs prints:
[] undefined
And there are definaly image files which has been uploaded to this collection.
+1