marcello3d/node-mongolian — pull request #90 by ryancole (2012-03-05 18:26:54+00:00)
Title: remove duplicate file name deletion. filename is not a unique identifier.

After reading the MongoDB documentation, it does not look like a file's name is supposed to be a unique identifier in GridFS. Looking over the Mongolian code, the `MongolianGridFile#save` method performs a `findOne` query, using the `filename` and `id` properties. If it locates a file with the same name, it deletes it. How to save files with the same name, then? I believe this is a mistake in the code. I also do not recognized the used `id` property - is that supposed to be `_id`? The existing GridFS file record does not have an `id` record, so that'll never match anyways, as far as I can tell.

I have removed this check-and-delete logic and the code appears to function as I would expect, now. I am able to insert multiple files with the same name, and they're giving their own record in GridFS.

This does break the unit tests, but after looking over the unit tests it looks like they were written from the perspective of a file's name being unique, which I think invalidates the unit tests as a whole for GridFS, and so I did not bother updating them.

Can we review the reasons why you consider `filename` to be unique, @marcello3d?