vsivsi / meteor-file-collection

Extends Meteor Collections to handle file data using MongoDB gridFS.
http://atmospherejs.com/vsivsi/file-collection
Other
159 stars 37 forks source link

Adding additional fields to the collection documents #103

Open jcheroske opened 8 years ago

jcheroske commented 8 years ago

I'm trying to save a FileCollection document with additional fields, such as foreign keys, but the fields are silently ignored upon insert. I can set certain fields, such as 'contentType' to whatever I want, but other fields that are outside the gridFS schema don't work. Is what I'm trying to do even possible? How do I enable my own custom fields in the FileCollection?

Thanks!

vsivsi commented 8 years ago

Typically you just add them under the metadata subdocument. File-collection drops them (nonstandard attributes) to maintain compliance with the gridFS spec, and since anything can exist under metadata it's not really much of a limitation.