I have an application that uses grids to upload files to mongodb. Its actually a two step process. First, the file is uploaded and upon success the filename is pushed into a collection (js array, not mongo collection) which is bound to the UI with angularjs. The filename is also added as a document to the mongodb. That part works just fine. The user can also delete a given file. Ideally, the process should simply be the reverse of the upload; delete the file from the db, and on success, remove the file name entry from its js and mongo collections. But, there seems to be no way to distinguish between two uploaded files, if they have the same name. How should I go about this. Should I add another step and update uploaded file's objected to the document, or is there a better way to do about this? Thanks
Asked
Active
Viewed 354 times