Socket
Socket
Sign inDemoInstall

gitlab-repo-db

Package Overview
Dependencies
10
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gitlab-repo-db

A database based on gitlab files


Version published
Weekly downloads
7
increased by40%
Maintainers
1
Install size
922 kB
Created
Weekly downloads
 

Readme

Source

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)

Keywords

FAQs

Last updated on 02 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc