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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -