mongo.sync.go

command module
v0.0.0-...-5fa7609 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

README

# mongo sync

To clone in real time using mongo stream a cluster into another cluster with the option to change the database name and the collection name.

## How to run it

- Create a file similar to options.json at the root folder and set the right configuration 
- Set an environment variable to point to this file
- run the code

here is a bash script example 
```bash
export SOAJS_MONGO_SYNC_OPTIONS=./options.json

go run ./main.go
```

### Environment variables
ENV Variable | Description | Default
--- | ----- | :---:
SOAJS_MONGO_SYNC_OPSTIME | 0 = turned off, 1 = start from yesterday, 2 = use time from options.json | 0
SOAJS_MONGO_SYNC_DEBUG | 0 = turned off, 1 = turned on | 0
SOAJS_MONGO_SYNC_OPTIONS | check options.json | no default, required

### Example
by setting SOAJS_MONGO_SYNC_OPSTIME=1 and adding copy=true in options.json, all document will be copied first and sync will start from yesterday's date

### License
*Copyright SOAJS All Rights Reserved.*

Use of this source code is governed by an Apache license that can be found in the LICENSE file at the root of this repository.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL