-
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_validation
feature 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_uuid
feature (also enabled by default) adds some useful extension methods to make it more convenient to work with UUIDs as the type of the_id
field.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 theDoc
derive proc-macro.
- Fix #2 by adding a
&self
parameter 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
Cursor
API
- Added a
remove_inner_doc()
method toDocumentExt
. This allows for the easy chaining of removal from hierarchically containedDocument
s 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
DocumentExt
trait 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 someCollection
methods- This means that single-element wrappers such as
Box<Doc>
andRefCell<Doc>
can no longer implementDoc
themselves
- 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_id
is 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
weights
property to text indices - Add migrations
- Default
Doc::Id
toObjectId
andQuery::Output
andFindAndUpdate::Output
toT
, once #29661 is stabilized