0.3.17 • Published 10 months ago

@auramarker/latdb v0.3.17

Weekly downloads
114
License
MIT
Repository
github
Last release
10 months ago

LatDB

一个基于文本的本地数据库。

API

const db = new LatDB(save_path)

Dict: 哈希表

db.dict.mydict.set('key', 1)
  • set(key, value)
  • get(key)
  • keys()
  • remove()
  • update(obj)
  • toJSON()
  • clear()

List: 列表

db.list.mylist.push('abc')
  • push(item)
  • pop()
  • lpush(item)
  • lpop()
  • rpush(item)
  • rpop()
  • extend(array)
  • lextend(array)
  • rextend(array)
  • all()
  • find(predicate)
  • filter(predicate)
  • map(predicate)
  • index(index)
  • indexOf(item)
  • clear()
  • remove()
  • slice(start, end?)
  • splice(start, delete_count, insert_items?)

Set: 集合

db.set.myset.add('abc')
  • add(value)
  • delete(value)
  • has(value)
  • all()
  • remove()

Collection

增强版的 List,用于存储复杂数据,每项记录都是一个 document,包含 _id 等字段。

db.collection.mycollection.insert({
  title: 'Title',
  content: 'Content',
})
  • insert(doc)
  • delete(_id)
  • update(_id, obj)
  • all()
  • find(predicate)
  • filter(predicate)
  • index(index)
  • count()
0.3.17

10 months ago

0.3.16

10 months ago

0.3.15

10 months ago

0.3.14

11 months ago

0.3.9

11 months ago

0.3.13

11 months ago

0.3.12

11 months ago

0.3.11

11 months ago

0.3.10

11 months ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.8

1 year ago

0.3.7

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.3.2

2 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago