gitlab-repo-db
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

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'
})

// dbName存储文件的路径,支持 a/b/c写法
const dbName = 'test'
const collection = DB.collection(dbName)


const query = {
  a: 1
}

// find all
collection.find(query)

// find one
collection.findOne(query)

// insert one
collection.insert({
  b: 1
})

// insert multiple
collection.insert([{
  b: 1
}, {
  c: 1
}])

// update
const updateData = {
  c: 1
}

const updateOption = {
  multi: true, // default: false
  upsert: true // default: false
} 

collection.update(query, updateData, option)

// remove all
collection.remove(query)

Readme

Keywords

Package Sidebar

Install

npm i gitlab-repo-db

Weekly Downloads

15

Version

0.1.5

License

MIT

Unpacked Size

6.01 kB

Total Files

7

Last publish

Collaborators

  • cyyjs