-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.ts
28 lines (26 loc) · 877 Bytes
/
example.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import dbCreator from "./dist/index";
import { resolve } from "path";
const dbPath = resolve(__dirname, "./db.jsonx");
dbCreator()
.read(dbPath)
.then(db => {
// db.query((key: string, val: any, parent: any) => {
// return Array.isArray(val);
// });
// const queryed = db.getQueryCache();
// console.log(queryed);
// db.update("user.name", "alan", { insert: true });
// db.insert("user", {
// name: "alan",
// age: 26
// });
// db.insert("login", [
// { timeStamp: new Date(), user: "alan" },
// { timeStamp: new Date(), user: "lucy" },
// { timeStamp: new Date(), user: "eroc" },
// ]);
// db.update("user.name", "alan");
console.log(db.getAll());
// console.log(db);
// db.write();
})