FR: Firestore Timestamp should have a comparator method #1922
Labels
api: firestore
Issues related to the googleapis/nodejs-firestore API.
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
The JS/TS API for Firestore's Timestamp (both web client Timestamp and node backend Timestamp) do not include a comparator function. This makes sorting accurately by Timestamp rather painful, as you have to write a function that manually compares both seconds and nanos. An easy workaround is to use
toMillis
, but it's lossy on nanos:Instead, it would be great if there was a comparator method provided in the same way as the Firestore Timestamp.compareTo() provided by the Java SDK.
Related issue for the Firebase web client SDK: firebase/firebase-js-sdk#7711
The text was updated successfully, but these errors were encountered: