mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-13 03:25:32 +00:00
db service: Count endpoint (#236)
This commit is contained in:
12
examples/db/count/node/countEntriesInATable.js
Executable file
12
examples/db/count/node/countEntriesInATable.js
Executable file
@@ -0,0 +1,12 @@
|
||||
import * as db from "m3o/db";
|
||||
|
||||
// Count records in a table
|
||||
async function CountEntriesInAtable() {
|
||||
let dbService = new db.DbService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await dbService.count({
|
||||
table: "users",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await CountEntriesInAtable();
|
||||
Reference in New Issue
Block a user