在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:syamdanda/jsonbase开源软件地址:https://github.com/syamdanda/jsonbase开源编程语言:JavaScript 100.0%开源软件介绍:Json-BaseA database software completely built as JSON files in backend. A powerful, portable and simple database works on top of JSON files. It is like a database software, currently having basic CRUD operation features. You can use this as a backend for your ReST APIs as well. The software is completely free and opensource. We are coming up with new features and providing more updates. The another beautiful advantage with JSON-base is since it is a NPM module, this fits well in your nodeJs applications eco system. if you want to develop quick prototypes/poc or need of a database with minimal requirements then, JSONBASe is an must option that you can consider. However there is a limitation if you go beyond a million records per table. @@ Currently in Pre-Alpha Version @@ Getting StartedThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes. Checkout the below examples to know how to use the JSON-Base built in APIs. InstallingA step by step series of examples that tell you how to get started with JSON-Base
And then import the json-base npm module into your nodejs application var jsonDB = require('@syamdanda/json-base'); DocumentationCheck-out the below code snippets to use the JSON-Base module in your application. Database Operations
let options = {
'name': 'myDatabase'
};
jsonDB.createDatabase(options, function(response) {
console.log(JSON.stringify(response));
});
let options = {
'name': 'myDatabase'
};
jsonDB.dropDatabase(options, function(response) {
console.log(JSON.stringify(response));
});
let options = {
'database': 'myDatabase',
'tableName': 'Users'
};
jsonDB.createTable(options, function(response) {
console.log(JSON.stringify(response));
});
let options = {
'database': 'myDatabase',
'tableName': 'Users'
};
jsonDB.dropTable(options, function(response) {
console.log(JSON.stringify(response));
});
let options = {
'database': 'myDatabase',
'tableName': 'Users',
'record': {'email': '[email protected]', 'phone': '+1 1234567890', 'name': 'userName'}
};
jsonDB.insertRecord(options, function(response) {
console.log(JSON.stringify(response));
});
let options = {
'database': 'myDatabase',
'tableName': 'Users',
'records': [{'email': '[email protected]', 'phone': '+1 1234567890', 'name': 'userName'},{'email': '[email protected]', 'phone': '+1 1234567890', 'name': 'userName2'}]
};
jsonDB.batchInsert(options, function(response) {
console.log(JSON.stringify(response));
});
let options = {
'database': 'myDatabase',
'tableName': 'Users',
'recordId': 1
};
jsonDB.getRecordById(options, function(response) {
console.log(JSON.stringify(response));
});
If you want to search and retrieve a record based on some key and value use the below method. let options = {
'database': 'myDatabase',
'tableName': 'Users',
'key': 'email',
'value': '[email protected]'
};
jsonDB.getRecordByKeyValue(options, function(response) {
console.log(JSON.stringify(response));
});
If you want to search and retrieve a record based on more than one key and value use the below method. let options = {
'database': 'myDatabase',
'tableName': 'Users',
'obj': {'email': '[email protected]', 'phone': '+1 1234567890', 'name': 'userName'}
};
jsonDB.getRecordByObject(options, function(response) {
console.log(JSON.stringify(response));
});
let options = {
'database': 'myDatabase',
'tableName': 'Users',
'key': 'email',
'value': 'gmail',
'flag': 'contains'
};
jsonDB.getRecordsBySearch(options, function(response) {
console.log(JSON.stringify(response));
});
let options = {
'database': 'myDatabase',
'tableName': 'Users'
};
jsonDB.getAllRecords(options, function(response) {
console.log(JSON.stringify(response));
});
let options = {
'database': 'myDatabase',
'tableName': 'Users',
'recordId': 1
};
jsonDB.deleteRecordById(options, function(response) {
console.log(JSON.stringify(response));
});
let options = {
'database': 'myDatabase',
'tableName': 'Users',
'recordId': 1,
'recordObj': {'email': 'new123', 'pwd': 'password'}
};
jsonDB.updateRecordById(options, function(response) {
console.log(JSON.stringify(response));
});
let options = {
'database': 'myDatabase',
'tableName': 'Users',
'key': 'email',
'value': '[email protected]',
'recordObj': {'email': 'new123', 'pwd': 'password'}
};
jsonDB.updateRecordByKeyValue(options, function(response) {
console.log(JSON.stringify(response));
}); ContributingPlease read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us. Versioning
AuthorsSee also the list of contributors who participated in this project. LicenseThis project is licensed under the MIT License - see the LICENSE.md file for details |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论