Skip to content
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

Allow update operators methods to act on multiple fields #2

Open
dagolden opened this issue Sep 24, 2013 · 1 comment
Open

Allow update operators methods to act on multiple fields #2

dagolden opened this issue Sep 24, 2013 · 1 comment

Comments

@dagolden
Copy link
Collaborator

It might be common to set multiple fields at once. Whether or not #1 is implemented, it might be useful to allow multiple fields to be updated at once:

$obj->update_set( field1, value1, field2, value2 );
$obj->update_set{ $hashref );

For push/add/remove, which take lists, it probably has to be a hash ref:

$obj->update_push( { field1 => [ qw/one two/ ], field2 => [ qw/three four/ ] } );

For methods that take only field names, maybe just a list is fine.

For consistency, then, maybe methods that take field and one or more values have to use hash reference form. For methods that take just a field get to take a list of one or more fields.

@toddbruner
Copy link
Contributor

This would be a very useful addition. In my application, I often need to update multiple fields and am beginning to worry about the roundtrip update costs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant