// Update modifies records located by a provided selector, must modifiy one record
Update modifies records located by a provided selector, must modifiy one record
// Update modifies records located by a provided selector must modifiy one record
func (m *Must) Update(ctx context.Context, selector interface{}, update interface{}) (*CollectionUpdateResult, error) {
	result, err := m.collection.Update(ctx, selector, update)
	if err != nil {
		return nil, err
	}
	if result.MatchedCount == 0 {
		return nil, NewErrNoDocumentFoundError("Must update, no document matched", nil)
	}
	return result, nil
}
func ( m * Must ) Update ( ctx context . Context , selector interface { } , update interface { } ) ( * CollectionUpdateResult , error ) { result , err := m . collection . Update ( ctx , selector , update ) if err != nil { return nil , err } if result . MatchedCount == 0 { return nil , NewErrNoDocumentFoundError ( " " , nil ) } return result , nil }
Update modifies records located by a provided selector, must modifiy one record
Update modifies records located by a provided selector must modifiy one record