Syntax
Arguments
List of field selectors to remove from the documents.Name of the field(s) to reference. Use dot notation to reference nested fields.
Optargs
Optional arguments to customize the behavior of the function. Provided as anobject.
Separator to use when referencing nested fields
Returns
For single objects, returns an object lacking the specified fields. For sequences, returns a
cursor pointing to the projected sequence of documents.
Behavior
- Removes the specified fields from each document.
- If a specified field doesn’t exist in a document, it’s ignored.
- When the primary key (
id) is not included in the returned fields, the cursor cannot be iterated over for updates.
Notes & Caveats
- The original documents are not modified; new documents are returned.
Example
Remove specific fields from a user
Remove thepassword field from a user document.
Remove fields from multiple documents
Remove theupdated_at and created_at fields from all blog posts.
Remove nested fields
Remove the nested address information from user documents.Related Functions
get- Get a document by primary keygetAll- Get multiple documentsfilter- Filter documentsfield- Reference a specific fieldupdate- Update documentsinsert- Insert new documentspluck- Pluck fields from documents
Found a typo? Or maybe a broken link? RuloDB is open-source, help us fix it!

