Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

prisma.db yaml

const { YamlDatabase } = require("prisma.db");
const db = new YamlDatabase({ dbPath: "./db.yaml" });

db.set("hello", "world"); /* String: World */
db.set("posts", [{ id: 1 }]); /* Array: [{ id: 1 }] */
db.push("posts", { id: 2 }); /* Array: [{ id: 1 }, { id: 2 }] */

db.fetch("hello"); /* String: World */
db.get("posts"); /* Array: [{ id: 1 }, { id: 2 }] */
db.has("posts"); /* Boolean: true */
db.dataAll(); /* Object: { hello: "World", posts: [{ id: 1 }, { id: 2 }] } */

db.set("a", 1);
db.add("a", 1); /* Number: 2 */
db.subtract("a", 1); /* Number: 1 */
db.math("a", "+", 12); /* Number: 13 */
db.math("a", "-", "1"); /* Number: 12 */
db.math("a", "*", "2"); /* Number: 24 */
db.math("a", "/", "2"); /* Number: 12 */
db.math("a", "%", "5"); /* Number: 1 */

db.type("hello"); /* String: "string" */
db.size(); /* Number: 1 */

db.delete("hello"); // returns true
db.clear(); /* Object: {} */
db.destroy(); /* Object: {} */
Comment

PREVIOUS NEXT
Code Example
Javascript :: VM1658:1 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 
Javascript :: verifier si chaien ade caractere apparait dans autre js 
Javascript :: puppeteer click is not working 
Javascript :: left join in javascript 
Javascript :: sort an array in descending order javascript 
Javascript :: upload file to api angular 
Javascript :: how to add header to axios request 
Javascript :: kth smallest element in an array js 
Javascript :: find leap year javascript 
Javascript :: convert .js file to ts 
Javascript :: canvas squashed video javascript 
Javascript :: html select structure 
Javascript :: set timeout with no name 
Javascript :: How to go back to previous route after authentication in nextjs 
Javascript :: how-can-i-implement-joi-password-complexity-in-joi-validation 
Javascript :: nodejs mysql escaping query 
Javascript :: .loads with whole json file 
Javascript :: convert csv to json typescript 
Javascript :: Number o flines of typography element react material 
Javascript :: jsf localdate converter 
Javascript :: google chrome extension v3 react content security policy issue 
Javascript :: How to add ui-scroll with remote data in angularjs 
Javascript :: Angular Frontend - How do I change a value I got from backend in frontend 
Javascript :: EXPO useEffect not called on navigating to same screen 
Javascript :: How to use search/filter for HTML Divs generated from JSON data using JavaScript 
Javascript :: fetch 500 internal server error 
Javascript :: ant design rtl 
Javascript :: json query rails c 
Javascript :: ... Notation In JavaScript 
Javascript :: how to install ghost js 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =