# mongovc

> node module for mongodb collection version control support

Latest version **0.0.35** (published 2017-11-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install mongovc
pnpm add mongovc
yarn add mongovc
bun add mongovc
```

Provides the command `mongovc`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.35 |
| Published | 2017-11-06 |
| First published | 2017-07-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+11 in 2 direct dependencies) |
| Install scripts | no |
| Author | Louie Almeda |
| Maintainers | louiealmeda |
| Keywords | mongodb, repository, versioning, collections, git, version, mongo, database |

## Links

- npm: https://www.npmjs.com/package/mongovc
- Homepage: https://github.com/louiealmeda/mongovc
- npm.io page: https://npm.io/package/mongovc

## Dependencies (4)

- [yargs](https://npm.io/package/yargs.md) ^8.0.2
- [colors](https://npm.io/package/colors.md) ^1.1.2
- [lodash](https://npm.io/package/lodash.md) 4.17.4
- [mongodb](https://npm.io/package/mongodb.md) ^2.2.26

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 0.0.35 (latest) — 2017-11-06
- 0.0.34 — 2017-11-06
- 0.0.33 — 2017-11-06
- 0.0.32 — 2017-11-06
- 0.0.31 — 2017-11-06
- 0.0.30 — 2017-11-05
- 0.0.29 — 2017-11-05
- 0.0.28 — 2017-11-02
- 0.0.26 — 2017-11-02
- 0.0.25 — 2017-10-30
- 0.0.24 — 2017-10-30
- 0.0.23 — 2017-10-30
- 0.0.22 — 2017-10-23
- 0.0.21 — 2017-10-07
- 0.0.20 — 2017-10-07
- … 19 more at https://npm.io/package/mongovc/versions

## README

# mongovc 
#### (mongo Version Control)
node module for mongodb collection version control support

Source codes are versioned for the team to collaborate easily and safely. Databases needs to be given the same collaboration procedure as business logic has been increasingly dependent on data. A lot of teams dump, restore and merge their versions of databases manually. Which leads to changes not being applied and causes unexpected behaviours.
 
mongovc aims to version mongodb collections properly so the need to copy-paste dumps can be obsoleted. 

### Features
- [x] Dump MongoDB collections as a readable files
- [x] Restore MongoDB collections from files
- [x] Create collection groups to specify which collections should be dump or restored 
- [x] Specify filter per collection
- [ ] Support Index Backup
- [ ] Automatically dump collections on `stat` of git 
- [ ] Automatically dump collections on before `pull` of git to check for conflicts
- [ ] Automatically restore collections after pull if there are no conflicts
- [ ] Connect with Authentication
- [ ] Deploy to a database
  - [ ] Run scripts before deployment
  - [ ] Run scripts after deployment
  - [ ] Specify deployment profiles

## Install

> npm install mongovc -g

if this is a new project, you should `--init`  
> mongovc --init

## How to use
Since automatic dump and restore is not yet supported, you can run the commands yourself for now.

### Help
show everything you can do with mongovc
```
mongovc --help
```

### dump collections
```shell
mongovc --dump
```

### restore collections
```shell
mongovc --restore
```

### specifying collections to dump/restore

```shell
mongovc --restore <group name>
mongovc --dump <group name>
```
you can specify groups in the `mongovc.config.js`

if group is not specified, it will use what is indicated in `collections` 

### initialize dev configuration
```shell
mongovc --init-dev
```

## Configuration
> mongovc.config.js
```javascript
{
  "database": "<databaseName>",
  "host": "localhost", //optional, default
  "port": "27017", //optional, default
  "collections": ["Accounts", "Stores"],
  "groups": {
    "all": [],
    "structure": [],
    "generated": []
  }
}
```

## Dev Configuration
> dev.mongovc.config.js

Same format with the main configuration. This file will override the main config's field that are specified.
All fields in this file are optional.
This is `.gitignored` so everyone can specify their own `database` and other configurations without conflicting with others.
[Can be automatically generated](https://github.com/louiealmeda/mongovc/blob/master/README.md#initialize-dev-configuration)

## License

Copyright (c) 2017 Mark Louie Almeda

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

---
_Source: https://npm.io/package/mongovc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
