-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collection update. #119
Collection update. #119
Conversation
lib/src/models/field.dart
Outdated
@@ -70,6 +71,28 @@ class Field extends Equatable { | |||
List<Object> get props => [name, type, isMultivalued]; | |||
} | |||
|
|||
class DroppableField extends Field { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @kishorenc
Since only fields can be updated as of now, I've created DroppableField
class to be used in the update function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@happy-san I think having an UpdateSchema
class as detailed in the issue is better because we can add other updatable fields to it in future. By using a List< DroppableField>
that flexibility is lost. With UpdateSchema
, the update operation will look like this:
final updateSchema = UpdateSchema(
{
Field('company_category', Type.string),
Field('num_employees', drop: true)
}
);
await client.collection('companies').update(updateSchema);
This also means that we need to add a drop
property to the field. We debated the semantics of doing this, but any alternative way of representing this became way too verbose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, I'll update this accordingly.
} | ||
} | ||
|
||
class CollectionUpdateSchema extends BaseSchema { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kishorenc I've added CollectionUpdateSchema
.
Change Summary
Support collection update operation.
#118
PR Checklist