MCPcopy Index your code
hub / github.com/appsignal/mongo-rust-driver

github.com/appsignal/mongo-rust-driver @0.2.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.2.4 ↗ · + Follow
183 symbols 465 edges 23 files 80 documented · 44%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Mongo Rust Driver

Build Status Crate

Mongo Rust driver built on top of the Mongo C driver. This driver is a thin wrapper around the production-ready C driver that provides a safe and ergonomic Rust interface which handles all the gnarly usage details of the C driver for you.

Bson encoding and decoding is handled by the bson crate, the bindings are based on generated bindings by bindgen.

The API should still be considered experimental, but I'm not expecting changes at the moment.

Documentation

Compatibility

The driver currently only builds on Unix, tested on Mac Os X and Linux so far. It's compatible with MongoDB 2.4 up to 3.2 and has full replica set and SSL support.

Logging

All internal logging by mongoc is redirected to the macros in the log crate. See the log docs to configure output in your application.

Examples

See the tests directory for examples of how to use the driver.

License

Licensed under either of

  • Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

at your option.

Contribution

Contributions are very welcome, only the functionality we use has been wrapped so far. Please write a test for any behavior you add.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Extension points exported contracts — how you extend this code

FlagsValue (Interface)
To provide the combined value of all flags. [4 implementers]
src/flags.rs

Core symbols most depended-on inside this repo

inner
called by 40
src/bsonc.rs
pop
called by 24
src/client.rs
mut_inner
called by 19
src/bsonc.rs
get_collection
called by 19
src/client.rs
find
called by 15
src/collection.rs
next
called by 15
src/cursor.rs
add
called by 12
src/flags.rs
drop
called by 9
src/collection.rs

Shape

Method 89
Function 44
Class 27
Enum 22
Interface 1

Languages

Rust100%

Modules by API surface

src/collection.rs31 symbols
src/client.rs23 symbols
src/error.rs18 symbols
mongoc-sys/src/lib.rs14 symbols
src/bsonc.rs12 symbols
src/database.rs11 symbols
src/flags.rs9 symbols
src/cursor.rs9 symbols
tests/client.rs8 symbols
src/read_prefs.rs8 symbols
src/lib.rs7 symbols
src/write_concern.rs6 symbols

Datastores touched

(mongodb)Database · 1 repos
dbDatabase · 1 repos

For agents

$ claude mcp add mongo-rust-driver \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page