You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ReplaceOne and UpdateOne wrapper functions in collection.go do not behave the same way, which can lead to some confusion. ReplaceOne does not return mongo.UpdateResult and will return an error if no document is found to replace, but UpdateOne does return mongo.UpdateResult and will not return an error.
Also, FindOne and FindOneAndUpdate return an error that does not clearly indicate whether the requested document was found.
Acceptance Criteria
Return mongo.UpdateResult object and error from ReplaceOne to standardize with UpdateOne
Return (bool, error) from FindOne and FindOneAndUpdate to give a better indication of whether the requested document was found
@petyos, @shurwit please let me know what you think of these proposed changes. Thanks.
The text was updated successfully, but these errors were encountered:
Description
The
ReplaceOne
andUpdateOne
wrapper functions incollection.go
do not behave the same way, which can lead to some confusion.ReplaceOne
does not returnmongo.UpdateResult
and will return an error if no document is found to replace, butUpdateOne
does returnmongo.UpdateResult
and will not return an error.Also,
FindOne
andFindOneAndUpdate
return an error that does not clearly indicate whether the requested document was found.Acceptance Criteria
mongo.UpdateResult
object anderror
fromReplaceOne
to standardize withUpdateOne
(bool, error)
fromFindOne
andFindOneAndUpdate
to give a better indication of whether the requested document was found@petyos, @shurwit please let me know what you think of these proposed changes. Thanks.
The text was updated successfully, but these errors were encountered: