Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement FieldValue.minimum() and FieldValue.maximum() #2024

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brettwillis
Copy link
Contributor

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

@brettwillis brettwillis requested review from a team as code owners March 18, 2024 22:22
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: firestore Issues related to the googleapis/nodejs-firestore API. labels Mar 18, 2024
@brettwillis
Copy link
Contributor Author

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.

@MarkDuckworth MarkDuckworth self-assigned this Mar 19, 2024
@MarkDuckworth MarkDuckworth added do not merge Indicates a pull request not ready for merge, due to either quality or timing. kokoro:run Add this label to force Kokoro to re-run the tests. labels Mar 19, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Mar 19, 2024
@MarkDuckworth
Copy link
Contributor

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.

@tom-andersen tom-andersen added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 22, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 22, 2024
@MarkDuckworth
Copy link
Contributor

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.

@brettwillis
Copy link
Contributor Author

Ok no worries thanks for the update.

@MarkDuckworth MarkDuckworth added do not merge Indicates a pull request not ready for merge, due to either quality or timing. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. do not merge Indicates a pull request not ready for merge, due to either quality or timing. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] Add support for minimum and maximum field transforms
4 participants