[x] build an attribute called collection_name, which will allow the user to specify exactly what they want the model's collection name to be.
[x] build an attribute called skip_serde_checks="(true|false)". This will allow the suppression of checking the model's serde derivations altogether. This is for the case where a user may have a custom serde implementation on their model.
[x] create a prelude module which will include all traits from wither & the proc macro from wither_derive.
[x] explore a better pattern for asserting against a Modelid field's type. Not even sure if it is a good idea to try to check that and warn the user if they are going astray ... we'll see.
[x] ensure struct has needed serde derivations Serialize & Deserialize unless serde checks are disabled. Not actually possible at this point in time as the proc_macro system doesn't seem to expose the derive attribute to the derivation delegates.
[x] finish up field level attrs for indexing:
[x] Need to update the field's order in the generated document. Must be 1 or
-1.
[x] Need to finish up the pattern for model(index(with(...))).
[x] Update the derive to take the pluralized form of the model's ident if model(collection_name) is not provided.
[x] update index(direction) to be index(index_type) & handle other index types:
[x] Finish up the pattern for model(index(weights(...))). Just need to have mapping of field names to i64. Can build the appropriate document from that data for an index's weights field.
[x] move any exhaustive index tests out of wither and into wither_derive.
[x] add tests for generating the various permutations of the above index types.
[x] clean up docs. Consolidate them as markdown docs in crate root, and then include them via #[doc(include)]. This will keep wither & wither_derive docs in sync.
[x] update README to show only the derive pattern, and show some basic save, find & update usage.
[x] update readme on how collection name generation works with explicit declaration & derivation based on model ident.
[x] get write concern model settings setup in the derive system.
[x] write_concern_w
[x] write_concern_w_timeout
[x] write_concern_j
[x] write_concern_fsync
[x] tests.
[x] need to handle indexing of fields which have a serde rename.
[x] put a plan of attack together on supporting indexes on nested models. Should be pretty straightforward. As a current workaround, users will simply have to implement the Model trait on their model manually. See #21.
[x] remove fn migrations from Model trait. Model::sync should only be for indexes.
[x] create a new Migrating trait. Users must manually impl Migrating for models if they need migrations. Should expose migrations() -> Vec<Migration> & migrate(db) to execute the migrations.
[x] There's a bug related to storage engine specs for model(index(storage_engine(...))). Opened #282 to have the bug fixed. If bug is not fixed by the time this is done, open an issue here to finish this up once the upstream fix is committed. See #22.
[x] There's a bug related to using geoHaystack indexes in the mongodb driver #289. Once it is fixed, it should just simply work as expected here. See #23.
[x] open PR to derive PartialEq on IndexOptions and implement a builder for it.
Closes #12 Closes #14 Closes #15 Closes #17 Closes #19
todo
collection_name
, which will allow the user to specify exactly what they want the model's collection name to be.skip_serde_checks="(true|false)"
. This will allow the suppression of checking the model's serde derivations altogether. This is for the case where a user may have a custom serde implementation on their model.prelude
module which will include all traits from wither & the proc macro from wither_derive.Model
id
field's type. Not even sure if it is a good idea to try to check that and warn the user if they are going astray ... we'll see.ensure struct has needed serde derivationsNot actually possible at this point in time as the proc_macro system doesn't seem to expose theSerialize
&Deserialize
unless serde checks are disabled.derive
attribute to the derivation delegates.model(index(with(...)))
.model(collection_name)
is not provided.index(direction)
to beindex(index_type)
& handle other index types:2d
https://docs.mongodb.com/manual/core/2d/.2dsphere
https://docs.mongodb.com/manual/core/2dsphere/.text
https://docs.mongodb.com/manual/core/index-text/.hashed
https://docs.mongodb.com/manual/core/index-hashed/.model(index(weights(...)))
. Just need to have mapping of field names toi64
. Can build the appropriate document from that data for an index's weights field.#[doc(include)]
. This will keep wither & wither_derive docs in sync.rename
.put a plan of attack together on supporting indexes on nested models. Should be pretty straightforward. As a current workaround, users will simply have to implement theSee #21.Model
trait on their model manually.fn migrations
fromModel
trait.Model::sync
should only be for indexes.Migrating
trait. Users must manually implMigrating
for models if they need migrations. Should exposemigrations() -> Vec<Migration>
&migrate(db)
to execute the migrations.There's a bug related to storage engine specs forSee #22.model(index(storage_engine(...)))
. Opened #282 to have the bug fixed. If bug is not fixed by the time this is done, open an issue here to finish this up once the upstream fix is committed.There's a bug related to usingSee #23.geoHaystack
indexes in the mongodb driver #289. Once it is fixed, it should just simply work as expected here.PartialEq
on IndexOptions and implement a builder for it.