Everyplay / backbone-db-mongodb

backbone-db driver for MongoDB
MIT License
2 stars 1 forks source link

Should gracefully handle integer id #4

Open mzabaluev opened 10 years ago

mzabaluev commented 10 years ago

When the id property is defined as type int in the database schema, the driver's mapping to MongoDB IDs should do something sensible or fail with an informative error if sensible behaviour is not obvious.

Nomon commented 10 years ago

What do you mean? Mongodb is perfectly ok with a non objectid (like integrer) _id.

Sent from my iPad

On 30 Oct 2014, at 19:25, Mikhail Zabaluev notifications@github.com wrote:

When the id property is defined as type int in the database schema, the driver's mapping to MongoDB IDs should do something sensible or fail with an informative error if sensible behaviour is not obvious.

— Reply to this email directly or view it on GitHub.

mzabaluev commented 10 years ago

In fact yes, changing the id property type to integer results in a test timeout in this example: https://github.com/mzabaluev/serverbone-example/blob/e46eb0393da9dc1ba2d7b2f3bc88884a48c88fc9/schemas/actor.js#L6