auto-migrate on update_multiple operations
endel opened this issue · comments
Endel Dreyer commented
Demonstration inconsistent API:
client: javascript> hook.collection("items").create({name: "Hey there"})
{ name: 'Hey there',
updated_at: Thu Apr 02 2015 15:22:15 GMT-0300 (BRT),
created_at: Thu Apr 02 2015 15:22:15 GMT-0300 (BRT),
_id: 1 }
client: javascript> hook.collection("items").update(1, {new_field: "1"})
{ _id: '1',
created_at: Thu Apr 02 2015 15:22:15 GMT-0300 (BRT),
updated_at: Thu Apr 02 2015 15:22:27 GMT-0300 (BRT),
name: 'Hey there',
new_field: '1' }
client: javascript> hook.collection("items").updateAll({new_field_2: "2"})
{ error: 'no such column: new_field_2', code: 500 }
When calling updateAll
the new_field_2
field should be created, as it occurs in update
call.