db.delete can't delete objects in array based on index if the array name contains dashes
fortlaxjoel opened this issue · comments
For example:
db.delete("/arraytest/my-array[0]");
// Wont work
db.delete("/arraytest/myarray[0]");
// Will work
I am storing an SSID as the array name and it would greatly simplify the code if i could keep it that way. Otherwise i will have to loop the array, match the SSID value, check the index of that value and delete the subdata based on the index where it matched the SSID value.
I have tried to encase the array name in brackets, to no avail.
Interestingly
db.delete("/arraytest/my-array");
// Will work just fine.
Anyone know a way to fix this?
Thanks for a great plugin.
I use xpath to find the object to delete, I was hoping xpath allows a '-' if it does not its going to be difficult one. But give me some time check it out
You'll have to excuse me, but im uncertain if i asked this question in the right github repo. I am using the jsondb package for node found here: https://www.npmjs.com/package/node-json-db
Is this an entirely different jsondb tool?....
@fortlaxjoel wrong repo
I will close this defect