nodejs-firestore
nodejs-firestore copied to clipboard
feat: Implement FieldValue.minimum() and FieldValue.maximum()
Taking a bit of a liberty here to implement something that touches the public API, but I figure it's simple enough and it's been mentioned that it is on the list but not a high priority, so hopefully this is a help an not a hinderance 🙏🏼
Fixes #1701
Also an off-topic request (it is a backend feature not an SDK feature): It would be create if the backend also supported Timestamps as min/max operands, not just numbers. Would be super useful for incrementing/retaining "createdAt"/"updatedAt" timestamp fields, as an example.
Thanks @brettwillis. At a glance this looks good. I'll do a full review soon. We will have to hold off on releasing this until after April 11th.
Update on this. Since this is a public API change, and one that will also be ported to all Firebase/Firestore SDKs, I have initiated an internal API review for the change.
Also, we're considering alternative names takeMinimum(val) and takeMaximum(val), to give the methods verbs and make them consistent with other FieldValues.
Ok no worries thanks for the update.