php-jsondb icon indicating copy to clipboard operation
php-jsondb copied to clipboard

Update with adding new key

Open pobutaalex opened this issue 4 years ago • 1 comments

When you try to update the array if you want to add new key to it it trows exception 'Update method has an off key', is there a way to add function to be able to add new keys with update method?

Example i have array stored like this [ { "key": "javascript", "ru": { "value": "ru_RU" }, "bg": { "value": "bg_BG" }, "cs": { "value": "cs_CZ", }, "de": { "value": "de_DE" } } ]

now i want to update it to add new lang to be so

[ { "key": "javascript", "ru": { "value": "ru_RU" }, "bg": { "value": "bg_BG" }, "cs": { "value": "cs_CZ" }, "de": { "value": "de_DE" }, "fr": { "value": "fr_FR" } } ]

pobutaalex avatar May 21 '20 11:05 pobutaalex

This will be added in the next release. :)

Sent from Samsung S10

On Thu, 21 May 2020, 12:45 Alexander, [email protected] wrote:

When you try to update the array if you want to add new key to it it trows exception 'Update method has an off key', is there a way to add function to be able to add new keys with update method?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/donjajo/php-jsondb/issues/25, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC4YZGHRTZKQDKVLVEA6OKDRSUH5VANCNFSM4NGYWNVA .

donjajo avatar May 24 '20 07:05 donjajo