dart_algolia icon indicating copy to clipboard operation
dart_algolia copied to clipboard

`Timestamp` objects get transformed into `Map<String, dynamic>`

Open aabounegm opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. When using the official cloud_firestore SDK, any timestamps in the Firestore document get automatically converted to Timestamp objects. However, when using Algolia, they instead become a map that looks like {_seconds: 1643874320, _nanoseconds: 615000000} of type Map<String, dynamic>. This becomes especially inconvenient when using Firestore queries next to Algolia's, since two separate deserialization functions will have to be used.

Describe the solution you'd like I would like for the Algolia SDK to leave the original Firestore Timestamp objects intact for better compatibility with the official Firestore SDK.

Describe alternatives you've considered I considered writing separate factory constructors for .fromFirestore and .fromAlgolia, but it becomes inconvenient very quickly, especially that I want to migrate to automatically generated serialization functions using json_serializable.

aabounegm avatar Feb 04 '22 13:02 aabounegm