Issue Storing Arrays In SQLite Using JavaScript
I've been using Cordova and the storage adapter for SQLite. When I store objects using JSON.stringify and the retrieve them they work. I also have several fields that are arrays, b
Solution 1:
I don't see any problem ,you can access initial array after parsing (JSON.parse(yourStringifiedArrayString)).
var yourarr=["test1", "test2", "test3"];
var afterStringify = JSON.stringify(yourarr);
console.log('After Stringify:'+afterStringify);
var prevArr=JSON.parse(afterStringify);
console.log('After Parsing:'+prevArr);
//now access your array
alert(prevArr[1]);//will show test2
Solution 2:
I don't see a problem with saving an array as a delimited string - It works fine for me. Just need to recreate the array using split() method when you retrieve it from SQLite.
Post a Comment for "Issue Storing Arrays In SQLite Using JavaScript"