mongodb-odm
mongodb-odm copied to clipboard
Do not differentiate integer/float identifier types
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.