Syntax
Arguments
List of field selectors to pluck 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 containing only the specified fields. For sequences, returns
a cursor pointing to the projected sequence of documents.
Behavior
- Plucks out only the specified fields from each document, creating a projection.
- If a specified field doesn’t exist in a document, it’s omitted from the result.
- When the primary key (
id) is not included in the projected fields, the cursor cannot be iterated over for updates.
Notes & Caveats
- The original documents are not modified; new documents are returned.
Example
Pluck specific fields from a user
Get only theid, name and email fields from a user document.
Pluck fields from multiple documents
Get only theid, title and author fields from all blog posts.
Pluck nested fields
Get 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 documentswithout- Remove fields from documents
Found a typo? Or maybe a broken link? RuloDB is open-source, help us fix it!

