Skip to content

Commit 9630967

Browse files
committed
A few doc updates.
[ci skip]
1 parent d03de6f commit 9630967

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ changelog
22
=========
33

44
## 0.7
5-
Minimal changes per this release. The main issue being addressed here is [#20](https://github.com/thedodd/wither/issues/20). It is arguable that this is just a bug fix, but the interface for `Model.update` has changed enough with these updates, that a minor version increment is merited.
5+
Minimal changes per this release. The main issue being addressed here is [#20](https://github.com/thedodd/wither/issues/20). It is arguable that this is just a bug fix, but the interface for `Model.update` has changed enough with these updates that a minor version increment is merited.
66

77
The main thing to observe here is that `Model.update` now takes an optional filter document. If none is given, then this method will create a filter doc and populate it with the model's ID. If a doc is given, then it will have the `_id` key set (potentially overwritten) to the model's ID. Lastly, this method now returns `Result<Option<Self>>` to reflect the fallible nature of the update with a filter.
88

wither/src/model.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,7 @@ pub trait Model<'a> where Self: Serialize + Deserialize<'a> {
301301
}
302302
};
303303

304-
// Perform a FindOneAndUpdate operation on this model's document by ID. Will fail if this
305-
// model instance was never saved to the database to begin with.
304+
// Perform a FindOneAndUpdate operation on this model's document by ID.
306305
coll.find_one_and_update(filter, update, Some(options)).and_then(|docopt| match docopt {
307306
Some(doc) => match Self::instance_from_document(doc) {
308307
Ok(model) => Ok(Some(model)),

0 commit comments

Comments
 (0)