I am currently data into a local db as following:
window.localStorage.setItem('QQIDVAL' + ID, JSON.stringify(this));
How do I go about then retrieving all of the data that is in the localstorage and looking for ones that start with “QQ”
Also how do I go about selecting which columns I want to retreive as JSON.stringify(this) has a lot of columns but I only need a subset of those.
You can take advantage of the fact that
localStorageis treated like an object and do something like this (iterating through the keys and checking their name):You could also change the if statement to this:
Don’t have a reference to the
substr()documentation right now though, don’t recall if that’s the correct syntax.