Hey guys,
there is no detail into how the Ionic Storage operates.
Hence I struggle with the most efficient usage.
I am using a provider to operate on my Ionic storage collections. I have a json object with a list of movie items. I store it in a collection as a JSON, i.e. myMovieStorage.set[‘myMovieCollection’, someMovieObject.json]
Now I have a filter for categories. The user can change the filter settings via a filter menu and store the settings. The movies would then be filtered based on the category collection
How should I store and operate with the selected categories? There are two approaches:
Store the whole category as JSON in one single collection such as:
storage.set[‘mySelectedCategories’, {‘Action’ : 1, ‘Comedy’: 0, 'Thriller:: 1, etc…}]
Then I would iterate through the JSON object to filter my movieCollection
Create a seperate storage provider to store the selection as key/value pairs, such as:
storage.set[‘Action’, 1]
storage.set[‘Thriller’, 0]
storage.set[‘Comedy’, 1]
How is the storage ment to be used in my case, what is more efficient in the end?
Thanks in advance!