Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How does UpdateAsync() work in Data Stores?

Asked by 5 years ago

So I have a datastore, when I need to update it I get the datastore, which is a nested array, then I change whatever is inside it and save it in the datastore again.

It looks like this: http://prntscr.com/kqifgw

I know that if you save it with SetAsync() it just overwrites the data. So if I kick someone from the guild on one server but in another it hasn't updated yet then datastore saves with the person not being kicked yet. UpdateAsync() is supposed to fix that. I just want to make sure that I understand how it works correctly that there won't be any problems with how I'm saving the datastore (Using UpdateAsync).

Thanks

1 answer

Log in to vote
0
Answered by 5 years ago

UpdateAsync() simply acts the same as SetAsync() it is intended to be used on records that already exist.

Ad

Answer this question