aheckmann/gridfs-stream — pull request #40 by llmora (2014-06-28 18:45:48+00:00)
Title: Support for arbitrary "_id" types

The "_id" of a file in the GridFS can be of any type (not just ObjectID), see:

http://mongodb.github.io/node-mongodb-native/api-generated/gridstore.html

Our application uses custom "_id" types and we noticed that gridfs-stream did not work as expected, tracked it down to a hard-coded support for ObjectIDs as the only supported type for "_id".

This simple pull request adds support for any type of object as the "_id", however to mantain backward compatibility strings of 12 or 24 characters are considered ObjectID identifiers and treated as such.

Added a couple of unit tests to test the new functionality.