{"id":19416728,"url":"https://github.com/mudge/oplog","last_synced_at":"2025-04-24T13:33:03.043Z","repository":{"id":57649974,"uuid":"58881678","full_name":"mudge/oplog","owner":"mudge","description":"A Rust library for iterating over a MongoDB replica set oplog.","archived":false,"fork":false,"pushed_at":"2018-03-17T15:48:36.000Z","size":5594,"stargazers_count":7,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-10T09:16:09.471Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://crates.io/crates/oplog","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mudge.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-15T20:01:32.000Z","updated_at":"2020-05-06T10:44:33.000Z","dependencies_parsed_at":"2022-09-05T13:22:27.122Z","dependency_job_id":null,"html_url":"https://github.com/mudge/oplog","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudge%2Foplog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudge%2Foplog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudge%2Foplog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudge%2Foplog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mudge","download_url":"https://codeload.github.com/mudge/oplog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223954837,"owners_count":17231189,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T13:04:23.886Z","updated_at":"2024-11-10T13:04:24.396Z","avatar_url":"https://github.com/mudge.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oplog [![Build Status](https://travis-ci.org/mudge/oplog.svg?branch=master)](https://travis-ci.org/mudge/oplog)\n\nA Rust library for\n[iterating](https://doc.rust-lang.org/1.14.0/std/iter/index.html) over a\n[MongoDB replica set\noplog](https://docs.mongodb.com/v3.0/core/replica-set-oplog/).\n\n**Current version:** 0.3.0  \n**Supported Rust versions:** 1.14\n\n## Install\n\nInstall Oplog by adding the following to your `Cargo.toml`:\n\n```toml\noplog = \"0.3.0\"\n```\n\n## Usage\n\n```rust\n#[macro_use]\nextern crate bson;\nextern crate mongodb;\nextern crate oplog;\n\nuse mongodb::{Client, ThreadedClient};\nuse oplog::{Operation, Oplog, OplogBuilder};\n\nfn main() {\n    let client = Client::connect(\"localhost\", 27017).expect(\"Failed to connect to MongoDB.\");\n\n    if let Ok(oplog) = Oplog::new(\u0026client) {\n        for operation in oplog {\n            match operation {\n                Operation::Noop { timestamp, .. } =\u003e println!(\"No-op at {}\", timestamp),\n                Operation::Insert { timestamp, .. } =\u003e println!(\"Insert at {}\", timestamp),\n                Operation::Update { timestamp, .. } =\u003e println!(\"Update at {}\", timestamp),\n                Operation::Delete { timestamp, .. } =\u003e println!(\"Delete at {}\", timestamp),\n                Operation::Command { timestamp, .. } =\u003e println!(\"Command at {}\", timestamp),\n                Operation::ApplyOps { timestamp, .. } =\u003e println!(\"ApplyOps at {}\", timestamp),\n            }\n        }\n    }\n\n    // Or, if you want to filter out certain operations:\n\n    if let Ok(oplog) = OplogBuilder::new(\u0026client).filter(Some(doc! { \"op\" =\u003e \"i\" })).build() {\n        for insert in oplog {\n            println!(\"{}\", insert);\n        }\n    }\n}\n```\n\n## Documentation\n\nFull API documentation is available at http://mudge.name/oplog\n\n## References\n\n* [Iterators, Rust by Example](http://rustbyexample.com/trait/iter.html)\n* [Replication Internals](https://www.kchodorow.com/blog/2010/10/12/replication-internals/)\n* [applyOps](https://docs.mongodb.com/manual/reference/command/applyOps/)\n* [ripgrep](https://github.com/BurntSushi/ripgrep/) was invaluable as a source of idiomatic Rust code (see also [ripgrep code review](http://blog.mbrt.it/2016-12-01-ripgrep-code-review/))\n\nAnd many thanks to [Ryman](https://github.com/Ryman) for his help along the way.\n\n## License\n\nCopyright © 2016-2018 Paul Mucur.\n\nDistributed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmudge%2Foplog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmudge%2Foplog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmudge%2Foplog/lists"}