I’m putting together a small document management application with Node.js and MongoDB. At this point I’m able to rather easily create documents in a collection I call documents (meaning electronic documents, not mongodb objects) which have a half dozen attributs. I’m also able to save files using GridFS, which creates fs.files and fs.chunks objects. What I’d really like to do is store the metadata directly on the gridfs fs.files objects (provided I still have access to all the search capabilities).
I can’t find any way to do this though. It seems I’m going to have to have the 2 separate collections and relate the 2 by having the Object IDs of the fs.files objects in the documents objects as a value.
Is there some way to have the metadata on the fs.files objects I’m just not seeing? Any links to anyone doing this would be helpful.