gitlab-repo-db
基于Gitlab 仓库文件存储的数据库
安装
yarn add gitlab-repo-db
使用
const DB = new GitlabDB({
url: 'your gitlab api url',
projectID: 'repo project id',
token: 'your gitlab token'
})
const dbName = 'test'
const collection = DB.collection(dbName)
const query = {
a: 1
}
collection.find(query)
collection.findOne(query)
collection.insert({
b: 1
})
collection.insert([{
b: 1
}, {
c: 1
}])
const updateData = {
c: 1
}
const updateOption = {
multi: true,
upsert: true
}
collection.update(query, updateData, option)
collection.remove(query)