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

[Firestore] Add ARRAY_UNION, ARRAY_REMOVE ARRAY_CONTAINS FieldValues #6546

Closed
crwilcox opened this issue Nov 16, 2018 · 1 comment
Closed
Assignees
Labels
api: firestore Issues related to the Firestore API. triaged for GA type: process A process-related concern. May include testing, release, or the like.

Comments

@crwilcox
Copy link
Contributor

There is no support for FieldValue.arrayUnion()/FieldValue.arrayRemove() and no support for array-contains Queries.

@tseaver
Copy link
Contributor

tseaver commented Nov 16, 2018

#6481 added support for the array_contains query operator.

We don't really have a FieldValue concept in Python: rather, we will have wrappers (like constants.DELETE_FIELD or constants.SERVER_TIMESTAMP) which will be used to signal those transforms by embedding the in the native Python dict. E.g.:

from google.cloud.firestore_v1beta1 import ArrayUnion, ArrayRemove

document_data = {
    'a': {
        'b': ArrayUnion([3, 4, 5]),
        'c': ArrayRemove([2, 7]), 
    },
}

@JustinBeckwith JustinBeckwith added the triage me I really want to be triaged. label Nov 17, 2018
@tseaver tseaver added the type: process A process-related concern. May include testing, release, or the like. label Nov 19, 2018
@JustinBeckwith JustinBeckwith removed the triage me I really want to be triaged. label Nov 19, 2018
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 Firestore API. triaged for GA type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

No branches or pull requests

3 participants