Skip to main content

count()

Use this when you want to get the number of matching records.

Available Keys

Key NameDescriptionOptionalNotes
whereSpecify retrieval conditionsYesIf omitted, all rows are retrieved
orderBySort settingsYesIf specifying only one column, the array can be omitted
takeSet the number of records to retrieveYes
skipSet the number of records to skipYes
cursorCursor-based paginationYesSee findMany cursor for details
tip

In where, you can also use relation filters (some / every / none / is / isNot).

Example Sheet

Example Sheet

Explanation

Suppose you want to perform the following operation from the example above.

  • age => 20 or greater

The code would be as follows.

// gassma.{{TARGET_SHEET_NAME}}.count
const result = gassma.sheet1.count({
where: {
age: {
gte: 20,
},
},
});

The return value is in the following format.

9