SDK : Insert
Insert lets you add items to a user's database. This API will return a promise that gets resolved once the item has been durably inserted into the database.
userbase.insert(databaseName, item, itemId)
.then(() => {
// item inserted
})
.catch((e) => console.error(e))
Parameters
-
databaseName [string | Len: 1-50] - The database name to use.
-
itemId [string | Len: 1-100] - The item's unique identifier.
-
item [object | Max size: 10 KB] - The item to insert.
Errors
- DatabaseNotOpen
- DatabaseNameCannotBeBlank
- DatabaseNameTooLong
- DatabaseNameMustBeString
- ItemIdCannotBeBlank
- ItemIdTooLong
- ItemIdMustBeString
- ItemTooLarge
- ItemAlreadyExists
- AppIdNotSet
- AppIdNotValid
- ServiceUnavailable