Closed magiclen closed 4 years ago
@magiclen I've given this a decent bit of thought since before setting out to build this crate. I have some discussion points here: https://docs.rs/wither/0.8.0/wither/model/trait.Model.html#derive starting with the line For now, it seems logical to disallow customization of the PK.
What are your thoughts on that? Is there a case which can not be satisfied by simply adding a unique index to another field and using that as the PK? Is it mostly a matter of semantics and keeping things terse? Is it a problem with BSON OIDs?
@magiclen just wanted to see if you have any thoughts on the response above.
Sometimes we don't want that the id field is named
id
, and don't want it to be anObjectId
(Option<mongodb::oid::ObjectId>
precisely).Perhaps
wither
can allow the following code in the future: