0.1.4 • Published 5 years ago

@dxdeveloperexperience/git-webhooks-database v0.1.4

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

Git-Webhooks-Database

Mongodb API to interact with Git-Webhooks project.

Getting Started

Download

npm i @dxdeveloperexperience/git-webhooks-database

Create database

In mongo shell:

use git_webhooks
db.remote_envs.insert({})
db.remote_rules.insert({})
db.remote_crons.insert({})
db.remote_envs.remove({})
db.remote_rules.remove({})
db.remote_crons.remove({})

This script will create the 3 collections you need in the git_webhooks database.

Usage

const API = require('@dxdeveloperexperience/git-webhooks-database');
const localdb = API.localdb;

const remoteRules = API.models.remoteRules;
const remoteEnvs = API.models.remoteEnvs;
const remoteCrons = API.models.remoteCrons;

const main = async () => {
  await localdb
    .connection()
    .then(res => console.log(res))
    .catch(err => console.error(err));

  await remoteEnvs
    .insertMany([
      { content: { gitApi: 'myAPI', gitToken: 'myToken' }, path: 'myPath' },
    ])
    .then(res => console.log(res))
    .catch(err => console.error(err));
};

main();
0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.0

5 years ago