Discussing Firebase Extension and Timestamp Implementation.
TLDR Loic enquired about timestamp inf Firebase implementation. Jason confirmed it's supported and shared the extension version, its functionality, and where the conversion happens. Loic planned to test this.
2
May 12, 2022 (20 months ago)
Loic
12:27 AMJason
12:28 AMJason
12:28 AMJason
12:28 AMLoic
12:29 AMJason
12:29 AMLoic
12:29 AMJason
12:29 AMJason
12:30 AMLoic
12:30 AMDateTime.now().millisecondsSinceEpoch
?Jason
12:31 AMLoic
12:31 AMMath.floor(value.toDate().getTime() / 1000);
Loic
12:32 AMmillisecondsSinceEpoch
or millisecond
Loic
12:32 AMLoic
12:32 AMJason
12:32 AMLoic
12:33 AMJason
12:33 AMLoic
08:18 PMI was able to send
Timestamp
from Firebase -> to Typesense int64
When I do the other way, I search and receive the
int64
in my app and it is the same value as in Typesense ✔️However, this Timestamp (for example: 1652386231) is supposed to be in
millisecondsSinceEpoch
but for some reason if I want to compare a date I have to use the received Timestamp as millisecondsSinceEpoch
but the other date as seconds
For example if I get the
lastConnection
from a Typesense search and I then want to compare I have to do:lastConnection.millisecondsSinceEpoch > Timestamp.fromDate(DateTime.now().subtract(const Duration(seconds: 70))).seconds
Loic
08:20 PMJason
08:20 PMJason
08:20 PM/ 1000
partLoic
08:21 PMExample of timestamp in second: 1652386236
Example of timestamp in millisecond: 1652386236975
Example of timestamp stored in typesense: 1652386231
Jason
08:22 PM1652386958
: https://www.epochconverter.com/Jason
08:23 PM1
Jason
08:23 PMLoic
08:26 PM1
Typesense
Indexed 3015 threads (79% resolved)
Similar Threads
Troubleshooting 400 Error When Upgrading Typesense Firestore Extension
Orion experienced a `400` error after updating the Typesense Firestore extension, causing issues with cloud functions. They traced the issue back to a data type conflict in their Typesense collection schema after updating. With help from Jason and Kishore Nallan, they resolved the issue by recreating the collection.
Handling Order of Firestore Events for Synchronization with Typesense.
Ross ran into an issue with Firestore events triggering out of order, causing synchronization inconsistency between Firestore and Typesense. With advice and input from Jason and Kishore Nallan, they implemented a debouncing solution using redis, ensuring that the latest Firestore data is synced to Typesense accurately.
Resolving Typesense Cloud and Firebase Timestamp Error
Eoin faced an issue with Firebase timestamp when setting up Typesense Cloud. Jason suggested converting timestamps to Unix and sync them as int64 fields in Typesense.
Resolving Typesense 0.22.2 Syntax Error and Import Issues
John faced issues with Typesense 0.22.2 code syntax and import functionality. Jason advised to reformat the JSONL records into single lines, increase ulimit, and convert dates to int64 format manually in code. A typo in the code was also corrected.
Sorting Results in Typesense and Handling Errors
Ramees asks about sorting results by distance in Typesense, entering a list of strings as a field, and resolving an error with `fields` format. Kishore Nallan assists with these issues and advises on storing timestamps and proper authentication.