Menu
  • HOME
  • TAGS

How can I query an FS collection in Meteor from the command line?

database,image,mongodb,meteor,collectionfs

Go to the Meteor Mongo console: meteor mongo See all the collections that are available: show collections Look for the one that has cfs.collection_name.files Choose the one that has your collection name. For example, I'm using collectionFS with gridFS for images. When I type show collections, I see cfs_gridfs.images.files so...

How to get location/url of image from CollectionFS (Meteor)

node.js,image,mongodb,meteor,collectionfs

The path is at fileObj.url(). If you have different stores you can get the url to different stores using fileObj.url("storeName"). If you want to set an image src use a technique like so: {{#each shopimage}} <img src="{{this.url store='images'}}"> {{/each}} Where: shopimage : function () { return ShopImages.find(); } ...

Meteor data context with collectionFS

meteor,collectionfs

I guess you need to access the parent context. Try it with {{../fave.title}} or {{fave.title ..}}. Note that grand-parent context could also be reached using {{../.. fave.title}}...

In Meteor, the Images collection is undefined in the FS.Store.GridFS transformWrite function

javascript,meteor,compilation,scope,collectionfs

Since you mentioned that it works for your friend but not you, it's probably not an issue with the code itself. Try running meteor reset.

CollectionFS: insert image generated server-side

meteor,graphicsmagick,collectionfs

Solved with help from @andrew-lavers response to this question gm(200, 200, '#000F') .setFormat('png') .fill('black') .drawCircle( 50, 50, 60, 60 ) .toBuffer( Meteor.bindEnvironment( function( error, buffer ) { if( error ) throw error; var file = new FS.File(); file.attachData( buffer, {type: 'image/png'}, function( err ) { if( err ) throw err;...