Skip to content

how to create a a new node #1

Description

@adhvaithprasad

hey hi guys how do you create a new branch with the database ?? ie :

var EasyDB = require('easydb')
var db = new EasyDB('file.json')

db.ready = function(){

	//Print file.json value
	console.log(db.value)

	//Manipulate db.v object as you want
	db.value.a = []
	db.value.a.hello ="world" 

	//Write db.value to file.json
	db.write(function(){
		console.log(db.value);
	})
	
}

and the expected output as :

{
  a:[
   hello :"world"
]
}

but when I try the code I get the console output correctly
but in the file.json I get

{"a":[
  
]}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions