47 lines
1.2 KiB
HTML
47 lines
1.2 KiB
HTML
<div class="section">
|
|
<h2><a href="/docs/#sdk">SDK</a> : Insert</h2>
|
|
|
|
<p><span class="font-semibold">Insert</span> 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.</p>
|
|
|
|
<pre>
|
|
<code class="language-javascript">userbase.insert(databaseName, item, itemId)
|
|
.then(() => {
|
|
// item inserted
|
|
})
|
|
.catch((e) => console.error(e))</code>
|
|
</pre>
|
|
|
|
<h3 id="params">Parameters</h3>
|
|
|
|
<ul>
|
|
<li>
|
|
<span class="field">databaseName</span> [string | Len: 1-50] - The database name to use.
|
|
</li>
|
|
<li>
|
|
<span class="field">itemId</span> [string | Len: 1-100] - The item's unique identifier.
|
|
</li>
|
|
<li>
|
|
<span class="field">item</span> [object | Max size: 10 KB] - The item to insert.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3 id="errors">Errors</h3>
|
|
|
|
<ul>
|
|
<li>DatabaseNotOpen</li>
|
|
<li>DatabaseNameCannotBeBlank</li>
|
|
<li>DatabaseNameTooLong</li>
|
|
<li>DatabaseNameMustBeString</li>
|
|
<li>ItemIdCannotBeBlank</li>
|
|
<li>ItemIdTooLong</li>
|
|
<li>ItemIdMustBeString</li>
|
|
<li>ItemTooLarge</li>
|
|
<li>ItemAlreadyExists</li>
|
|
<li>AppIdNotSet</li>
|
|
<li>AppIdNotValid</li>
|
|
<li>ServiceUnavailable</li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<hr> |