androz2091 / easy-json-database Goto Github PK
View Code? Open in Web Editor NEW📂 Easy to use json database. Used for Scratch For Discord.
📂 Easy to use json database. Used for Scratch For Discord.
Aujouter db.gpush() pour add une data dans tout les objets
db.get("aa") // {lol:"haha"}
db.gpush({keske:"ayaa"}) // undefined
db.get("aa") // {lol:"haha", keske:""ayaa}
(keske:""ayaa ajouté à toutes les data présentes)
Bonjour Androz,
J'ai fais ceci :
const Database = require("easy-json-database");
const db = new Database("../../money.sql");
await db.add(message.author.id, 100);
var a = db.get(message.author.id);
message.channel.send(`+100, money ${a}`)
Et cela fonctionne.
Ducoup est ce du json ?
Ou alors cela écrit bien ?
Ya t'il un risque que les données soient corrompues, car le JSON est réputé pour.
Bonjour,
en utilisent le module je me suis rendu compte que pour choisir la déstination des backups il fait faire
const db = new Database("./some-database.json", {
snapshots: {
enabled: true,
interval: 24 * 60 * 60 * 1000,
path: './backups/'
}
});
et non pas
const db = new Database("./some-database.json", {
snapshots: {
enabled: true,
interval: 24 * 60 * 60 * 1000,
folder: './backups/'
}
});
j'éspère que cela vous sera utile :)
Bonjour,
j'essaye de set un truc mais avec la feature que j'ai proposé j'ai un bug
la voici:
TypeError: Cannot set property '754038841001640099' of undefined
(index.js:10)
const db = require('easy-json-database');
const file1 = new db('./linked.json');
file1.delete('pending.' + interaction.options.getString('code'));
After running this piece of code, the piece of data still exists.
Salut,
Comment peut-on faire ce truc en json avec le module?
{
"bonjour": {
"bonjour": "bonjour"
}
}
Si ce n'est pas possible vous pouvais ajouter cette fonctionnalité sur le module ?
TypeError: path.join is not a function
at EasyJsonDB.makeSnapshot (D:\Khanh\vscode\recommendations\node_modules\easy-json-database\index.js:87:31)
at Timeout._onTimeout (D:\Khanh\vscode\recommendations\node_modules\easy-json-database\index.js:60:22)
When will it be added?
i basically wanted to make some sort of a discord bot which uses machine learning (it generates responses from prompts), when i try to send the result which should be a string it tells me that "you cant send an empty message", i can print the result using console.log though
Implement:
const userID = '8874748974';
db.set(userID, {
age: 23,
name: 'Kevin'
});
db.set(`${userID}.age`, 24);
Im getting this error while im trying to run my project on my virtual machine:
TypeError: key.split is not a function
at setNestedProperty (C:\Users\Sapol\Desktop\CliGame\node_modules\easy-json-database\index.js:4:28)
at EasyJsonDB.set (C:\Users\Sapol\Desktop\CliGame\node_modules\easy-json-database\index.js:129:9)
at C:\Users\Sapol\Desktop\CliGame\index.js:22:6
at Layer.handle [as handle_request] (C:\Users\Sapol\Desktop\CliGame\node_modules\express\lib\router\layer.js:95:5)
at next (C:\Users\Sapol\Desktop\CliGame\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (C:\Users\Sapol\Desktop\CliGame\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (C:\Users\Sapol\Desktop\CliGame\node_modules\express\lib\router\layer.js:95:5)
at C:\Users\Sapol\Desktop\CliGame\node_modules\express\lib\router\index.js:281:22
at Function.process_params (C:\Users\Sapol\Desktop\CliGame\node_modules\express\lib\router\index.js:335:12)
at next (C:\Users\Sapol\Desktop\CliGame\node_modules\express\lib\router\index.js:275:10)
You can see my code here: https://hastebin.com/yezopozehu.js
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.