JsStore provides count api to count no of records in a table. You can use Where to filter results similar to select.

Sql

Select count(*) From Table_Name;
Where
    Column1=some_value
and
    Column2=some_another_value;

JsStore

const results = await connection.count({
    from: "Table_Name",
    where: {
        Column1: some_value,
        Column2: some_another_value
    }
});
// results will be a number
console.log(results);

Example