Crate mongo_sync

Source
Expand description

Mongo sync lib, which provides an easily usage api to sync data from one mongodb to another mongodb.

Provides two syncer: MongoSyncer and OplogSyncer, and one cleaner OplogCleaner.

OplogSyncer is used to sync cluster oplog, and MongoSyncer is used to sync mongodb data. OplogCleaner is used to clean too old oplog data.

§OplogSyncer example:

use mongo_sync::OplogSyncer;
let oplog_syncer = OplogSyncer::new("mongodb://localhost:27017", "mongodb://localhost:27018").unwrap();
oplog_syncer.sync_forever();

§MongoSyncer example:

use mongo_sync::{DbSyncConf, MongoSyncer};

let conf = DbSyncConf::new("mongodb://localhost:27017".to_string(), "mongodb://localhost:27018".to_string(), "mongodb://localhost:27017".to_string(), "a".to_string(), None, None, None);
let syncer = MongoSyncer::new(&conf);
syncer.sync();

§OplogCleaner example:

use mongo_sync::OplogCleaner;
let oplog_cleaner = OplogCleaner::new("mongodb://localhost:27018".to_string());
oplog_cleaner.run_clean();

Modules§

cmd_oplog
Provide structured command type oplog definition.

Structs§

Connection
A simple abstraction for mongodb syncer connection.
DbSyncConf
database sync configuration.
MongoSyncer
Mongodb syncer to sync from one database to another database.
OplogCleaner
A cleaner to clean too old oplog, which is synced by OplogSyncer.
OplogSyncer
A syncer to sync oplogs from one mongodb cluster to another mongodb.
OplogSyncerConfig
Global mongo syncer configuration.

Enums§

SyncError

Type Aliases§

Result