snippetql
v1.0.0
Published
Snippet QL is No SQL Language for JSON Light Weight Application
Downloads
2
Readme
QUICK START CRUD
- Initialize Database
const SnippetQL = require('snippetql');
SnippetQL.initializeDB();
const usersCollection = SnippetQL.collection("users");
- Insert Database
usersCollection.insert({ username: "alamwibowo", password: "123456" });
- Update Database
/**
* Fungsi Update Data
* @return {Boolean}
*/
const update = usersCollection
.where("username")
.equal("alamwibowo")
.update({ address: "Jl. Alam Selangit 2" });
- Delete Database
/**
* Fungsi Delete Data
* @return {Boolean}
*/
const hapus = usersCollection.where("username").equal("alamwibowo").delete();
- Select Database
/**
* Fungsi query dengan where clauses
* @return {Object}
*/
const getAll = usersCollection
.select("*")
.hideField("password")
.build();
/**
* Fungsi query dengan where clauses
* @return {Object}
*/
const getUsernameAndPassword = usersCollection
.where("username")
.equal("alamwibowo")
.and("password")
.equal("123456")
.build();