Syntax
Arguments
List of arguments to provide.A single document object or an array of document objects to insert into the table. Each document
should be a valid JSON object.
Optargs
No optional arguments.Returns
Information about the operation.
Behavior
- If no primary key (
id) is provided, RuloDB automatically generates a unique ID. - When inserting multiple documents, the operation is performed in a single batch for efficiency.
- On primary key conflict, the conflicting document will be replaced with the new one.
Notes & Caveats
- Documents must be valid JSON objects (no functions, undefined values, etc.).
- Auto-generated primary keys are ULID by default.
- Primary key fields cannot be
nullorundefined. - Primary key must be a string.
Example
Insert a single document
Insert a new user into the users table.Insert multiple documents
Insert several users in a single batch operation.Related Functions
get- Get a document by primary keygetAll- Get multiple documentsupdate- Update existing documentsdelete- Delete documentstable- Reference a table
Found a typo? Or maybe a broken link? RuloDB is open-source, help us fix it!

