mongodb/node-mongodb-native — pull request #970 by Raynos (2013-05-06 23:07:41+00:00)
Title: Allow calling `findOne(id)` with a string

Rational:

- Having the pay attention to whether an id variable contains a string
or an ObjectID instance is a source of common bugs / confusion.
- Having a way to call `findOne(string)` will get rid of 95% of the
usage of the ObjectID constructor in common code and thus
reduce exposure of the mongo _id implementation detail.

Down-sides:

- probably not compatible with the js mongo console
- `find(id)` doesn't work (also doesn't make sense), may cause confusion.

In general I think this is worthwhile mainly because it avoids the confusion of "why does findOne({ _id: id }) not work?!?!?" and allows me to not litter my application code with references to `ObjectID` which is very specific to the mongo database and not specific to my application.