doc.field(), which retrieves that field’s value from every document in the result set.
Syntax
Arguments
List of arguments to provide.Name of the field to reference. Use dot notation to reference nested fields. To reference
non-nested fields, use the field’s name as a reference (see in the
examples).
Optargs
Optional arguments to customize the behavior of the function. Provided as anobject.
Separator to use when referencing nested fields
Returns
Returns the value of the referenced field. The type of the value depends on the contents of that
field in each document.
Behavior
- The
object.field()function is aware of the table’s schema if defined.
Notes & Caveats
- Whenever a field name contains a dot (
.), provide a custom separator using theseparatoroption to avoid unexpected behavior.
Example
Filter users that are older than 21
Filter for users in theusers table where the user’s age is greater than or equal to 21.
Filter orders from the UAE
Filter for orders in theorders table where the order’s shipping address country is UAE, where the country is a nested field of address.
Filter for usernames
Filter for users in theusers table where the user’s property.username (literal field name) is john. In this example, we use the separator option to specify a custom separator for nested fields.
Related Functions
eq- Logical Equality Operationne- Logical Inequality Operationlt- Logical Less Than Operationle- Logical Less Than or Equal Operationgt- Logical Greater Than Operationge- Logical Greater Than or Equal Operationand- Logical AND Operationor- Logical OR Operationnot- Logical NOT Operationtable- Referencing a Tablefilter- Filtering Documents
Found a typo? Or maybe a broken link? RuloDB is open-source, help us fix it!

