meteor - collectionfs insert userid for insert method -
meteor - collectionfs insert userid for insert method -
the default collectionfs insert function add together images info mongodb cfs.images.filerecord collection, how can add together userid insert method whenever need find images userid?
fs.utility.eachfile(event, function(file) { images.insert(file, function (err, fileobj) { }); });
to acces userid of current in meteor can use
meteor.users.findone({})._id
you can insert in collection illustration through
images.insert( { user: meteor.users.findone({})._id images.insert(file, function (err, fileobj) } )
meteor
Comments
Post a Comment