-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Sync
-
3 - M (<= 1 month)
-
5990
-
Not Needed
There is an oddity at play in that MongoDB has millisecond precision and Realm uses nanosecond precision. This means that when we receive a query from Realm on a timestamp that has non-zero nanoseconds we can't safely convert that into a MongoDB date time query in such a way that we could guarantee the same results we send is what a local realm query would return.
I am not sure what the best route forward is, but I wanted to file a ticket to have it exist here in the hopes we can align on this at some point. This could include:
1. Only storing millisecond prevision
2. Only allowing queryies on millisecond precision
3. Anything else we think of
Error we generate:
encountered session error in QUERY message ||| unsupported query for table [STRING]: invalid timestamp query: can't use the '<=' operator with a timestamp value with precision finer than one millisecond. Truncate the timestamp to millisecond precision or change the query to use '<' or '>' instead.
Relevant Link: https://github.com/10gen/baas/blob/b5d4ba5013c044a9da4fc4358ecd894d0cc50b6e/realm/rql/mql_convert.go#L502