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

[FR] Add support for minimum and maximum field transforms #1701

Open
ChrisSSocha opened this issue Mar 17, 2022 · 1 comment · May be fixed by #2024
Open

[FR] Add support for minimum and maximum field transforms #1701

ChrisSSocha opened this issue Mar 17, 2022 · 1 comment · May be fixed by #2024
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.

Comments

@ChrisSSocha
Copy link

Is your feature request related to a problem? Please describe.

The minimum and maximum field transforms (which are available in the REST API) have not been implemented in the Firestore Node SDK

Describe the solution you'd like

I imagine the API for this would look very much like FieldValue.increment(...), and would look something like:

// ...
const washingtonRef = db.collection('cities').doc('DC');

// Atomically set the value of population to the minimum of 50 or it's existing value 
const res = await washingtonRef.update({
  population: FieldValue.minimum(50)
});

Describe alternatives you've considered
n/a

Additional context
n/a

@ChrisSSocha ChrisSSocha added 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. labels Mar 17, 2022
@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/nodejs-firestore API. label Mar 17, 2022
@schmidt-sebastian
Copy link
Contributor

Thank you for this feature request! We have talked about adding this internally before, but have not yet prioritized this work. We can revisit this decision now that we have some customer demand.

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. 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants