Full support for deriving indexes on EMBEDDED docs & find_one_and_* methods.
0.8
The core wither
crate is 100% backwards compatible with this release, but the Model
trait has received a few additional methods. Namely the find_one_and_(delete|replace|update)
methods. Came across a use case where I needed them and then realized that I never implemented them. Now they are here. Woot woot!
The wither_derive
crate has received a few backwards incompatible changes. The motivation behind doing this is detailed in #21. The main issue is that we need the derive system to be abstract enough to deal with embedded documents. The backwards incompatible changes are here.
- within
#[model(index())]
, theindex_type
attr has been reduced to simply beindex
. All of the same rules apply as before. This change was made for ergonomic reasons. Less typing. Easier to follow. - within
#[model(index())]
, thewith(...)
attr has been updated to support subdocuments. The new syntax for this attr iswith(field="...", index="...")
. Supply awith(...)
attr for each independent field to include. - within
#[model(index())]
, theweights(...)
attr has been updated for the same reason aswith
. Now, you need to supply oneweight(field="...", weight="...")
per field weight you are specifying.
The only net-new item being added here is that now, within #[model(index())]
, you can use the attr embedded="..."
to cause the index declaration to apply to the embedded document/field specified. See the docs for more details.
It is my sincere hope that this is the last breaking change I will need to make to this crate before promoting this crate to a 1.0.0
release. Let's hope! Please let me know if there are any issues you have with these updates.