1.1.9 • Published 4 years ago

odies.database v1.1.9

Weekly downloads
62
License
ISC
Repository
-
Last release
4 years ago

Odies Database

Türkçe MongoDB, JSONDB ve YAMLDB Veritabanı Modülü.

Örnekler;

//MongoDatabase (Table oluşturmadan);

const { Mongo } = require('odies.database');
const db = new Mongo('mongodb://')

await db.set('data', 'value') // value
await db.delete('data') // true

await db.set('data', 'value') // value
await db.fetch('data') // value
await db.get('data') // value

await db.push('datas', 'a') // ["a"]
await db.push('datas', 'b') // ["a", "b"]
await db.unpush('datas', 'a') // ["b"]

await db.add('number', 10) // 10
await db.subtract('number', 5) // 5

await db.deleteAll() // true

await db.all() 

const QuickDb = require('quick.db');
await db.move({database: 'quick.db'}, QuickDb)

await db.ping() //okuma: ***, yazma: ***, ortalama: ***

//MongoDatabase (Table oluşturarak);

const { MongoTable } = require('odies.database');
const table = new MongoTable('mongodb://', {table: 'odies'})

await table.set('data', 'value') // value
await table.delete('data') // true

await table.set('data', 'value') // value
await table.fetch('data') // value
await table.fetch('data') // value

await table.push('datas', 'a') // ["a"]
await table.push('datas', 'b') // ["a", "b"]
await table.unpush('datas', 'a') // ["b"]

await table.add('number', 10) // 10
await table.subtract('number', 5) // 5

await table.deleteAll() // true

await table.all() 

const QuickDb = require('quick.db');
await table.move({database: 'quick.db'}, QuickDb)

await table.ping() //okuma: ***, yazma: ***, ortalama: ***

//JSON Database (Table oluşturmadan);

const { JSON } = require('odies.database');
const jsondb = new JSON('database') // Bu kısıma sadece dosya adını girmeniz yeterli olacaktır.

await jsondb.set('data', 'value') // value
await jsondb.delete('data') // true

await jsondb.set('data', 'value') // value
await jsondb.fetch('data') // value
await jsondb.fetch('data') // value

await jsondb.push('datas', 'a') // ["a"]
await jsondb.push('datas', 'b') // ["a", "b"]
await jsondb.unpush('datas', 'a') // ["b"]

await jsondb.add('number', 10) // 10
await jsondb.subtract('number', 5) // 5

await jsondb.deleteAll() // true

await jsondb.all() 

const QuickDb = require('quick.db');
await jsondb.move({database: 'quick.db'}, QuickDb)

//JSON Database (Table oluşturarak);

const { JSONTable } = require('odies.database');
const jsontable = new JSON('database', {table: 'odies'}) // Bu kısıma sadece dosya adını girmeniz yeterli olacaktır.

await jsontable.set('data', 'value') // value
await jsontable.delete('data') // true

await jsontable.set('data', 'value') // value
await jsontable.fetch('data') // value
await jsontable.fetch('data') // value

await jsontable.push('datas', 'a') // ["a"]
await jsontable.push('datas', 'b') // ["a", "b"]
await jsontable.unpush('datas', 'a') // ["b"]

await jsontable.add('number', 10) // 10
await jsontable.subtract('number', 5) // 5

await jsontable.deleteAll() // true

await jsontable.all() 

const QuickDb = require('quick.db');
await jsontable.move({database: 'quick.db'}, QuickDb)

//YAML Database (Table oluşturmadan);

const { YAML } = require('odies.database');
const yamldb = new YAML('database') // Bu kısıma sadece dosya adını girmeniz yeterli olacaktır.

await yamldb.set('data', 'value') // value
await yamldb.delete('data') // true

await yamldb.set('data', 'value') // value
await yamldb.fetch('data') // value
await yamldb.fetch('data') // value

await yamldb.push('datas', 'a') // ["a"]
await yamldb.push('datas', 'b') // ["a", "b"]
await yamldb.unpush('datas', 'a') // ["b"]

await yamldb.add('number', 10) // 10
await yamldb.subtract('number', 5) // 5

await yamldb.deleteAll() // true

await yamldb.all() 

const QuickDb = require('quick.db');
await yamldb.move({database: 'quick.db'}, QuickDb)

// YAML Database (Table oluşturarak);

const { YAMLTable } = require('odies.database');
const yamltable = new YAMLTable('database', {table: 'odies'}) // Bu kısıma sadece dosya adını girmeniz yeterli olacaktır.

await yamltable.set('data', 'value') // value
await yamltable.delete('data') // true

await yamltable.set('data', 'value') // value
await yamltable.fetch('data') // value
await yamltable.fetch('data') // value

await yamltable.push('datas', 'a') // ["a"]
await yamltable.push('datas', 'b') // ["a", "b"]
await yamltable.unpush('datas', 'a') // ["b"]

await yamltable.add('number', 10) // 10
await yamltable.subtract('number', 5) // 5

await yamltable.deleteAll() // true

await yamltable.all() 

const QuickDb = require('quick.db');
await yamltable.move({database: 'quick.db'}, QuickDb)

Döküman

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago