File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818
1919```
2020#### CRUD Operation
21- ```
21+ ``` diff
2222async function test(){
2323 const db= GithubDb({db:<DATABASE_NAME>,token:<TOKEN>});
2424
25- const {identifier}=await db.add({document:"user"},{name:"John"});
25+ + const {identifier}=await db.add({document:"user"},{name:"John"});
2626 console.log("added user", identifier);
2727
28- const user=await db.fetchOne({document:"user",identifier});
28+ + const user=await db.fetchOne({document:"user",identifier});
2929 console.log("fetched user", user);
3030
31- const updated=await db.update({document:"user",identifier},{name:"John Cena"});
31+ + const updated=await db.update({document:"user",identifier},{name:"John Cena"});
3232 console.log("updated user", updated);
3333
34- const users=await db.fetchAll({document:"user"});
34+ + const users=await db.fetchAll({document:"user"});
3535 console.log("fetched users", users);
3636 for (const {identifier} of users) {
37- const result=await db.delete({document:"user",identifier});
37+ + const result=await db.delete({document:"user",identifier});
3838 console.log("delete users", result);
3939 }
4040}
You can’t perform that action at this time.
0 commit comments