evelodb
v1.0.9
Published
An awesome local database admin with nodejs. Made by Evelocore. With B-tree Operations
Downloads
158
Maintainers
Readme
Requirements
- Node.js
Installation
Via npm
npm i evelodb
Manual Installation
- Download
evelodb.js
- Place it in your project directory
- First run creates
./evelodatabase/
automatically
Import
const eveloDB = require('evelodb')
const db = new eveloDB();
Operations
Create
// Structure
db.create('collection', {
key: 'value'
});
// Example
db.create('collection', {
username: 'evelocore',
name: {
firstname: 'Kumuthu',
lastname: 'Prabhasha'
},
email: '[email protected]'
});
Find
// Structure
const result = db.find('collection', {
key: 'value'
});
// Example
const user = db.find('collection', {
username: 'evelocore'
});
console.log(user)
Output
[
{
username: 'evelocore',
name: 'Evelocore',
developer: 'K.Prabhasha',
email: '[email protected]'
}
]
Search
// Structure
const result = db.search('collection', {
key: 'partial_value'
});
// Example
const user = db.search('collection', {
username: 'evelo'
});
console.log(user)
Output
[
{
username: 'evelocore',
name: 'Evelocore',
developer: 'K.Prabhasha',
email: '[email protected]'
}
]
Check Existence
// Structure
const exists = db.check('collection', {
key: 'value'
});
// Example
const exists = db.check('accounts', {
username: 'evelocore'
});
console.log(exists)
Output
true
Update
// Structure
db.edit('collection',
{ key: 'value' }, // find condition
{ key: 'new_value' } // new data
);
// Example
db.edit('accounts',
{ username: 'evelocore' },
{
name: 'EveloCore Official',
email: '[email protected]'
}
);
Delete
// Structure
db.delete('collection', {
key: 'value'
});
// Example
db.delete('accounts', {
username: 'evelocore'
});
Get full collection
// Structure
const result = db.get('collection');
// Example
const users = db.get('accounts');
console.log(users);
Inject full collection
// Structure
const result = db.inject('collection', data);
// Example
const users = db.inject('accounts', [
{ id: 1, name: 'Evelocore' },
{ id: 2, name: 'K.Prabhasha' },
]);
Reset Collection
// Structure
db.reset('collection');
// Example
db.reset('accounts');
Features
- ✓ JSON-based storage
- ✓ B-Tree indexing
- ✓ Fast retrieval
- ✓ Node.js only