mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-15 20:44:46 +00:00
Generate clients (#206)
This commit is contained in:
13
examples/db/read/node/readRecords.js
Executable file
13
examples/db/read/node/readRecords.js
Executable file
@@ -0,0 +1,13 @@
|
||||
import * as db from "m3o/db";
|
||||
|
||||
// Read data from a table. Lookup can be by ID or via querying any field in the record.
|
||||
async function ReadRecords() {
|
||||
let dbService = new db.DbService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await dbService.read({
|
||||
query: "age == 43",
|
||||
table: "users",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await ReadRecords();
|
||||
Reference in New Issue
Block a user