Back

Why can't we just update one key within user preference instead of the entire thing?

  • 1
  • Auth
  • Cloud
Abid G
4 Sep, 2024, 10:50

I have an issue where when I try to update one preference key-value pair, it updates the entire preferences. I'd like to only update one of these preferences and not the entire one

Just want to update one preference

TypeScript
 self.users.update_prefs(
    user_id=user_id, prefs={
        key: value}
)

Instead I need to get all of the current preferences and then update the entire preferences.

TL;DR
Developers are unable to update one key within a user's preferences independently; it currently requires updating the entire preference set. This is due to the preferences being stored as a single string in the database. There is a need to fetch all current preferences and then apply updates to the entire set rather than selectively updating one preference. Improvements are anticipated in database enhancements for version 1.7 that might address this issue.
Joshi
4 Sep, 2024, 10:55

Because in the database it is saved as a single string

Joshi
4 Sep, 2024, 10:55

You can't do partial updates yet only full updates.

Abid G
4 Sep, 2024, 10:56

Aaah, do you know if we have that in the pipeline somewhere?

Joshi
4 Sep, 2024, 11:08

From what I know they will work on database improvements in 1.7 so they might tackle this issue, but that is not confirmed.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more