0.3.4 • Published 1 month ago
@auramarker/latdb v0.3.4
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.4
1 month ago
0.3.3
1 month ago
0.3.2
1 year ago
0.3.1
2 years ago
0.3.0
2 years ago
0.2.6
3 years ago
0.2.5
3 years ago
0.2.4
3 years ago
0.2.3
3 years ago
0.2.2
3 years ago
0.2.1
3 years ago
0.2.0
3 years ago
0.1.8
3 years ago
0.1.7
3 years ago
0.1.6
3 years ago
0.1.5
3 years ago
0.1.4
3 years ago
0.1.3
3 years ago
0.1.2
3 years ago
0.1.1
3 years ago
0.1.0
3 years ago