Docs : SDK : updateItem
updateItem lets you modify an existing item in a user's database. This API will return a promise that gets resolved once the item has been durably updated in the database.
userbase.updateItem({
databaseName: 'example-database-name',
item: { example: 'Updated Sample Item A' },
itemId: '0001'
}).then(() => {
// item updated
}).catch((e) => console.error(e))
Parameters
-
databaseName [string | Len: 1-50] - The database name to use.
-
item [object | string | number | boolean | null | Max size: 10 KB] - The object to overwrite the existing item with.
-
itemId [string | Len: 1-100] - The unique identifier of the item to replace.
Errors
- ParamsMustBeObject
- DatabaseNotOpen
- DatabaseNameMissing
- DatabaseNameMustBeString
- DatabaseNameCannotBeBlank
- DatabaseNameTooLong
- ItemIdMissing
- ItemIdMustBeString
- ItemIdCannotBeBlank
- ItemIdTooLong
- ItemMissing
- ItemInvalid
- ItemTooLarge
- ItemDoesNotExist
- ItemUpdateConflict
- UserNotSignedIn
- UserNotFound
- TooManyRequests
- ServiceUnavailable