Good day, comrades! Help is needed! I started working on a single project in Node JS, and based on the MVC principle, I want to first create a database from scratch, without any third-party modules, programs, frameworks, etc. Help, how and where to start. But I know one that JSON is needed for this.
Thanks in advance!

  • What is the database for? - vp_arth

1 answer 1

The most banal is

var mydbdb = {} //ΠΏΠΎΡ‚ΠΎΠΌ ΠΏΠΈΡΠ°Ρ‚ΡŒ измСнСния Π½Π° диск fs.writeFileSync("./mydbdb.json", JSON.stringify(weights_JSON), 'utf8'); //ΠΈ ΠΏΡ€ΠΈ запускС ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹ ΡΡ‡ΠΈΡ‚Ρ‹Π²Π°Ρ‚ΡŒ Ρ‚Π°ΠΊ var mydbdb = JSON.parse(fs.readFileSync("./mydbdb.json")); 

The only thing that does not always work correctly with some objects, for example RegEx will be recorded as [Object]

If there is a ready-made wrapper of this type in the form of NeDB .