You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just starting using Cache and it's worked great so far but I'm wondering if there's a way to iterate the cache of objects? The specific case I have is I initially store my objects with a numeric ID (converted to String) as the key... later I wish to lookup/find an object, but I have a "name" rather than the ID, so I'd like to iterate the cached objects, checking the name property to find a match. Terribly inefficient but that's the nature of the beast at this point. As I type this I realize if there were a way to have multiple keys that referenced the same cache object, that could be a solution to this issue as well - and faster for lookup. Thoughts? Thanks!
The text was updated successfully, but these errors were encountered:
@ppearson111 Hi there, don't really see any good ways to iterate the cached objects. Cache is not a replacement of database, and even though files live in the folder, without the key it's not that easy to search/filter. I would recommend to store objects with any unique ID that you know at the moment of lookup. Could you use a "name" initially instead of numeric ID? Another option could be to cache objects as a JSON array, but it highly depends on the context.
Just starting using Cache and it's worked great so far but I'm wondering if there's a way to iterate the cache of objects? The specific case I have is I initially store my objects with a numeric ID (converted to String) as the key... later I wish to lookup/find an object, but I have a "name" rather than the ID, so I'd like to iterate the cached objects, checking the name property to find a match. Terribly inefficient but that's the nature of the beast at this point. As I type this I realize if there were a way to have multiple keys that referenced the same cache object, that could be a solution to this issue as well - and faster for lookup. Thoughts? Thanks!
The text was updated successfully, but these errors were encountered: