25 releases

Uses new Rust 2024

new 0.10.2 Aug 7, 2026
0.10.1 Dec 16, 2025
0.10.0 Jul 9, 2024
0.9.2 Oct 12, 2023
0.4.0 Jul 3, 2020

#987 in Database interfaces

Download history 18/week @ 2026-04-16 49/week @ 2026-04-23 79/week @ 2026-05-07 110/week @ 2026-05-14 138/week @ 2026-05-21 73/week @ 2026-05-28 134/week @ 2026-06-04 135/week @ 2026-06-11 53/week @ 2026-06-18 70/week @ 2026-06-25 43/week @ 2026-07-02 132/week @ 2026-07-09 114/week @ 2026-07-16 61/week @ 2026-07-23 27/week @ 2026-07-30

341 downloads per month

MIT/Apache

91KB
1.5K SLoC

Crates.io docs.rs Crates.io

MongODM

A thin ODM layer for MongoDB built upon the official Rust driver.

Main features:

  • A stronger API leveraging Rust type system
  • Data structure models are defined using the well-known serde serialization framework
  • Index support on top of the Database::run_command (index management is currently not implemented in the underlying driver)
  • Indexes synchronization
  • Additional compile-time checks for queries using macros and type associated to mongo operators (eg: And instead of "$and")

Examples

See documentation.

Tests

Some tests can be run with cargo test however most of the useful tests requires a Mongo database running and exposed on localhost:27017. These integration tests are run with cargo test -- --ignored. The authorization fallback test requires an authenticated MONGODB_URI with user-administration privileges and MONGODM_RESTRICTED_MONGODB_URI for its restricted user.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~29–47MB
~744K SLoC