https://github.com/lweaxo/lweaxodb
DataBase Modules
https://github.com/lweaxo/lweaxodb
database databases db javascript mangodb mangos typescript
Last synced: 5 months ago
JSON representation
DataBase Modules
- Host: GitHub
- URL: https://github.com/lweaxo/lweaxodb
- Owner: LWEAXO
- License: mit
- Created: 2024-08-23T22:42:16.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-20T17:17:04.000Z (over 1 year ago)
- Last Synced: 2025-11-27T09:08:56.198Z (7 months ago)
- Topics: database, databases, db, javascript, mangodb, mangos, typescript
- Language: JavaScript
- Homepage:
- Size: 45.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# lweaxodb



# What's new in 0.0.6?
- The web panel has been removed. (!)
- NPM bugs have been fixed (2x).
- Bugs and issues related to Mongoose and NPM have been fixed.
---
Examples
> (QuickDB) Moving Everything to lweaxodb
```js
const db = require("lweaxodb");
const quickdb = require("quick.db");
await db.move(quickdb)
```
> (JsonDB) Moving Everything to MongoDB
```js
const db = require("lweaxodb");
db.setAdapter("mongo", {url: "YOUR_MONGO_URL", Schema: "Schema Name"})
const JsonDB = require("../your_file.json");
db.moveToMongo(JsonDB)
//Github: LWEAXO
```
> Example
```js
const db = require("lweaxodb")
db.set("x.y.z", "abc") // abc
db.get("x") // {y: {z: "abc"}}
db.fetch("x") // {y: {z: "abc"}}
db.all() // {x: {y: {z: "abc"}}}
db.push("a", "hello") // ["hello"]
db.push("a", "world") // ["hello", "world"]
db.unpush("a", "hello") // ["world"]
db.push("b", {test: "lweaxodb"}) // [{test: "lweaxodb"}]
db.push("b", {test2: "lweaxodb2"}) // [{test: "lweaxodb"}, {test2: "lweaxodb2"}]
db.delByPriority("b", 1) // [{test2: "lweaxodb"}]
db.setByPriority("b", {newtest:"hey this is edited"}, 1) // [{newtest:"hey this is edited"}]
db.has("x") // true
db.delete("x") // true
db.deleteAll() // true
```
```js
const db = require("lweaxodb")
db.setAdapter("mongo",
{
url: "Your Mongo URL",
schema: "Schema Name" // Not required. You can't define your own schema. Just name.
})
await db.set("x.y.z", "abc") // abc
await db.get("x") // {y: {z: "abc"}}
await db.fetch("x") // {y: {z: "abc"}}
await db.all() // {x: {y: {z: "abc"}}}
await db.push("a", "hello") // ["hello"]
await db.push("a", "world") // ["hello", "world"]
await db.unpush("a", "hello") // ["world"]
await db.push("b", {test: "lweaxodb"}) // [{test: "lweaxodb"}]
await db.push("b", {test2: "lweaxodb2"}) // [{test: "lweaxodb"}, {test2: "lweaxodb2"}]
await db.delByPriority("b", 1) // [{test2: "lweaxodb"}]
await db.setByPriority("b", {newtest:"hey this is edited"}, 1) // [{newtest:"hey this is edited"}]
await db.has("x") // true
await db.delete("x") // true
await db.deleteAll() // true
```
> Example With Options
```js
const db = require("lweaxodb")
db.setReadable(true) // It makes readable your JSON DB file.
db.noBlankData(true) // If you delete anything from object and new object size is less than 1, automaticly removes that object.
db.setAdapter("yamldb") // It makes adapter as YAML adapter. Default adapter is JsonDB
db.setFolder("folder") // You can set database folder name
db.setFile("db") // You can set database file name
db.setCheckUpdates(true) // It warns you if any updates happens.
db.set("x.y.z", "abc") // abc
db.get("x") // {y: {z: "abc"}}
db.fetch("x") // {y: {z: "abc"}}
db.all() // {x: {y: {z: "abc"}}}
db.push("a", "hello") // ["hello"]
db.push("a", "world") // ["hello", "world"]
db.unpush("a", "hello") // ["world"]
db.push("b", {test: "lweaxodb"}) // [{test: "lweaxodb"}]
db.push("b", {test2: "lweaxodb2"}) // [{test: "lweaxodb"}, {test2: "lweaxodb2"}]
db.delByPriority("b", 1) // [{test2: "lweaxodb"}]
db.setByPriority("b", {newtest:"hey this is edited"}, 1) // [{newtest:"hey this is edited"}]
db.has("x") // true
db.delete("x") // true
db.deleteAll() // true
```
> DB Stats
```js
const db = require("lweaxodb")
console.log(db.size) // DB Size | DB Boyutu
console.log(db.version) // DB version | DB sürümü
```
---
### İletişim Bilgileri;