Crate mongo_sync[][src]

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

Provide structured command type oplog definition.

Structs

A simple abstraction for mongodb syncer connection.

database sync configuration.

Mongodb syncer to sync from one database to another database.

A cleaner to clean too old oplog, which is synced by OplogSyncer.

A syncer to sync oplogs from one mongodb cluster to another mongodb.

Global mongo syncer configuration.

Enums

Type Definitions