Skip to main content

Omit

You can omit fields in your query results by using the omit modifier. It applies a field mask to the result and returns all the fields except the omitted ones. If multiple omit method calls are chained then each call is concatenated to a list.

// Omits `compensation` and `benefit` fields from the query result
let result = await altogic.db
.model("employee")
.omit("compensation", "benefit")
.get();

Parameters

Here you can find parameters for the omit modifier.

#

Name

Data type

Required

Description

1...fieldsStringYesThe name of the fields that will be omitted in retrieved objects.
The field name can be in dot-notation to specify sub-object fields (e.g., field.subField).
caution

It throws an exception if no omitted fields are specified