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 (18 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 2776 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.
Troubleshooting Typesense Document Import Error
Christopher had trouble importing 2.1M documents into Typesense due to memory errors. Jason clarified the system requirements, explaining the correlation between RAM and dataset size, and ways to tackle the issue. They both also discussed database-like query options.
Troubleshooting 409 Errors with Firestore to Typesense Cloud Function
Orion encounters 409 errors with `ext-firestore-typesense-search-indexToTypesenseOnFirestoreWrite` cloud function. Jason suggests possible solutions like querying Firestore on each change or tracking sync state in a collection. Both agreed on adding a config option. Orion proposed contributing a PR for the change.