Meteor-CollectionFS icon indicating copy to clipboard operation
Meteor-CollectionFS copied to clipboard

displaying an image: findOne returns undefined

Open JohanTh opened this issue 9 years ago • 1 comments

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.

JohanTh avatar Aug 01 '15 18:08 JohanTh

+1

RavDanny avatar Jul 21 '16 00:07 RavDanny