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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Feature: Partial List updates #2531

Open
2 tasks done
maximilianmaihoefner opened this issue Dec 29, 2021 · 3 comments
Open
2 tasks done

馃殌 Feature: Partial List updates #2531

maximilianmaihoefner opened this issue Dec 29, 2021 · 3 comments
Labels
enhancement New feature or request product / databases Fixes and upgrades for the Appwrite Database.

Comments

@maximilianmaihoefner
Copy link

馃敄 Feature description

When updating a Array-Field in a Document it would be nice if we could add and remove entries from the List without having to specify the entire List. This extends to the read and write Permissions.

In Firebase this is implemented using the FieldValue.arrayUnion and FieldValue.arrayRemove methods.

馃帳 Pitch

When adding a user to the read-Permission of a Document it would be much easier to just specify the user that should be added.

appwriteDatabase.updateDocument(
        collectionId: 'collectionId',
        documentId: 'documentId',
        data: {},
        read: FieldValue.arrayUnion(['user:$memberId']),
);

Alternatively we could prefix the String we want to add or remove with +/-, but that might be limiting for Lists of other types.

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@PineappleIOnic
Copy link
Member

Thank you for your suggestion!
We will think about this and see if we can achieve it possibly after 0.12 has been released, we will make sure to stay in contact and update you on the status of this feature request as it progresses. 馃檪

@CodesbyRobot
Copy link

CodesbyRobot commented Jul 23, 2022

+1, This is super useful and necessary i believe in case of real time updates for some events (likes count/dislikes count) without having to do any check on the front side and update the entire array. Any delay on the front side means that the value on the server will be wrong.

@stnguyen90 stnguyen90 added the product / databases Fixes and upgrades for the Appwrite Database. label Feb 27, 2023
@Vedsaga
Copy link

Vedsaga commented May 17, 2023

I guess, we should create seperate method for de-linking document in case of relationship or
or may be it could be other way around, having seperate method of partial update in that case will save from needing to change in existing update function but simply need to write new method one just do partial update to existing field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

5 participants