serby / save-mongodb

mongodb persistence engine for save
ISC License
13 stars 14 forks source link

Convert query of #findOne() to have idProperty of type ObjectID #5

Closed OliverJAsh closed 11 years ago

OliverJAsh commented 11 years ago

This allows you to find by ID in your application without first having to convert your query to ObjectID on the application side:

Before:

userService.findOne({ _id: new ObjectID(user._id) }, function (err, entity) {})

After:

userService.findOne({ _id: user._id }, function (err, entity) {})
serby commented 11 years ago

FYI I've just released a version that includes this change.