Syntax
Arguments
List of arguments to provide.The primary key value of the document to retrieve.
Optargs
No optional arguments.Returns
Returns the document object if found, or
null if no document exists with the specified key.Behavior
- Retrieves exactly one document based on the primary key.
- Returns
nullif no document is found with the specified key. - The operation uses the table’s primary key index for optimal performance.
Notes & Caveats
- RuloDB uses
idas the primary key field.
Example
Get a user by ID
Retrieve a specific user by their ID from the users table.Get a document from a specific database
Retrieve an order from the orders table in the ecommerce database.Related Functions
getAll- Get multiple documents by primary keysfilter- Filter documents by conditionstable- Reference a tableinsert- Insert documentsupdate- Update documentsdelete- Delete documents
Found a typo? Or maybe a broken link? RuloDB is open-source, help us fix it!

