Categorygithub.com/soajs/mongo.sync.go
modulepackage
0.0.0-20211006150616-5fa760961d0f
Repository: https://github.com/soajs/mongo.sync.go.git
Documentation: pkg.go.dev

# 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

export SOAJS_MONGO_SYNC_OPTIONS=./options.json

go run ./main.go

Environment variables

ENV VariableDescriptionDefault
SOAJS_MONGO_SYNC_OPSTIME0 = turned off, 1 = start from yesterday, 2 = use time from options.json0
SOAJS_MONGO_SYNC_DEBUG0 = turned off, 1 = turned on0
SOAJS_MONGO_SYNC_OPTIONScheck options.jsonno 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.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author