-
Notifications
You must be signed in to change notification settings - Fork 157
Labels
api: firestoreIssues related to the googleapis/nodejs-firestore API.Issues related to the googleapis/nodejs-firestore API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
This is a clone of firebase/firebase-js-sdk#2632.
[REQUIRED] Describe the problem
Unable to compare Timestamp instances with native comparators. Javascript calls valueOf()
on the object and uses the results of that to do native comparisons.
Steps to reproduce:
Attempt to compare Timestamps directly.
Relevant Code:
firebase = require('firebase-admin')
a = new firebase.firestore.Timestamp(1, 1)
b = new firebase.firestore.Timestamp(2, 2)
console.log(a < b) // false
console.log(b < a) // false
Workaround
Of course you can simply call toMillis()
and compare those, but having it auto handled would be better.
mono0926
Metadata
Metadata
Assignees
Labels
api: firestoreIssues related to the googleapis/nodejs-firestore API.Issues related to the googleapis/nodejs-firestore API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.