// DeleteById deletes record based on the id selector must delete at least one record
DeleteById deletes record based on the id selector must delete at least one record
// DeleteById deletes record based on the id selector must delete at least one record
func (m *Must) DeleteById(ctx context.Context, id interface{}) (*CollectionDeleteResult, error) {
	result, err := m.collection.DeleteById(ctx, id)
	if err != nil {
		return nil, err
	}
	if result.DeletedCount < 1 {
		return nil, NewErrNoDocumentFoundError("Must delete by id, no document deleted", nil)
	}
	return result, nil
}
func ( m * Must ) DeleteById ( ctx context . Context , id interface { } ) ( * CollectionDeleteResult , error ) { result , err := m . collection . DeleteById ( ctx , id ) if err != nil { return nil , err } if result . DeletedCount < 1 { return nil , NewErrNoDocumentFoundError ( " " , nil ) } return result , nil }
DeleteById deletes record based on the id selector must delete at least one record
DeleteById deletes record based on the id selector must delete at least one record