donjajo / php-jsondb

A PHP Class that reads JSON file as a database. Use for sample DBs
MIT License
212 stars 56 forks source link

Update with adding new key #25

Open pobutaalex opened 4 years ago

pobutaalex commented 4 years ago

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" } } ]

donjajo commented 4 years ago

This will be added in the next release. :)

Sent from Samsung S10

On Thu, 21 May 2020, 12:45 Alexander, notifications@github.com 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 .