-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Per https://docs.mongodb.com/ruby-driver/current/tutorials/bson-v4/#time-instances,
> Times in BSON (and MongoDB) can only have millisecond precision. When Ruby Time instances are serialized to BSON or Extended JSON, the times are floored to the nearest millisecond.
> Because of this flooring, applications are strongly recommended to perform all time calculations using integer math, as inexactness of floating point calculations may produce unexpected results.
Yet _matches? doesn't apply that logic, which means it can be inaccurate.
https://github.com/mongodb/mongoid/pull/5094 should address this.
- is cloned by
-
MONGOID-5237 Add Feature Flag: _matches? should use millisecond precision when comparing Time objects
- Closed
- links to