mongodb-odm icon indicating copy to clipboard operation
mongodb-odm copied to clipboard

Do not differentiate integer/float identifier types

Open jmikola opened this issue 11 years ago • 0 comments

See https://github.com/doctrine/mongodb-odm/pull/444#issuecomment-12294445:

Don't differentiate between integers and floats (see aa168b1), which will make this consistent with MongoDB's comparison behavior

Beyond that, the only caveat I see is that searching by an integer/float will not find a numeric string, and vice versa. This is evident in the IdTest fix made in https://github.com/doctrine/mongodb-odm/commit/aa168b1d33e8ce397455a2b49252f682b10f1f3d#L2L84 -- it may bite some users, but I think it's necessary unless we want to seriously complicate the IdType class.

MongoDB considers integers and float types equivalent for purposes of matching and indexing (including uniqueness). We should do the same in UnitOfWork's identity map.

jmikola avatar Jan 16 '14 20:01 jmikola