-
See the online documentation above, or open it locally:
-
cargo doc --open -
Check out the
examples/folder -
More high-level information can be found on the project page.
-
The
schema_validationfeature can be enabled (it's enabled by default), in which case theDatabaseExt::empty_collection()method becomes available. If a collection is created using this method, it will add a JSON schema validation pass and specify the schema as generated bymagnet. -
The
raw_uuidfeature (also enabled by default) adds some useful extension methods to make it more convenient to work with UUIDs as the type of the_idfield.This can potentially be slow if you are performing many insertions into a collection of a complex type. However, it dynamically ensures that other users/drivers can't put malformed data in the collection. Therefore it's probably more useful if you or somebody else are accessing a database from outside the Avocado driver too. It's also great for debugging Avocado itself.
- Fix #6 by adding a context dictionary to
Error.
- Fix #5 by adding an
#[options(...)]attribute to theDocderive proc-macro.
- Fix #2 by adding a
&selfparameter to theoptions()methods onops::traits.
- Fix a deprecation warning related to
Uuid::from_random_bytes() - Catch some errors that incorrectly pass through the MongoDB client's
CursorAPI
- Added a
remove_inner_doc()method toDocumentExt. This allows for the easy chaining of removal from hierarchically containedDocuments intransform(). - Fixed a bug where inserting 0 entities into a collection failed.
- Fixed the incorrect ordering of the key and the value type in the error message generated by
DocumentExt::remove_*()methods.
- Added a
DocumentExttrait to the prelude for convenient and idiomatic implementation oftransform(raw: Document) -> Result<Bson>methods - Hopefully fixed the code so that docs.rs can handle it now
- Added
Doc::id()andDoc::set_id()methods for the sake of better efficiency in someCollectionmethods- This means that single-element wrappers such as
Box<Doc>andRefCell<Doc>can no longer implementDocthemselves
- This means that single-element wrappers such as
- Added
Collection::find_one_and_delete(),Collection::find_one_and_replace(), andCollection::find_one_and_update()methods - Added more documentation and clarified/improved existing docs
- Added more tests, including compile-time tests for cases when
#[derive(Doc)]should fail, as well as testing that an optional_idis correctly allowed
Due to a bug in compiletest_rs, running the tests that check the error
messages of the #[derive(Doc)] proc-macro requires running cargo clean
first, otherwise compilation will fail with E0464.
Therefore, the recommended way of running the tests is:
cargo clean && cargo test
- Add
weightsproperty to text indices - Add migrations
- Default
Doc::IdtoObjectIdandQuery::OutputandFindAndUpdate::OutputtoT, once #29661 is stabilized