List of Storage Keys in Script

28 views
Skip to first unread message

Patrick

unread,
Sep 8, 2014, 6:24:34 PM9/8/14
to websc...@googlegroups.com
Is there a simple way to get a list of all my storage keys from within my script?

I'm storing some settings in JSON in the form "id:<id>" and I'd like to get a list of all the ids that have been created so far.

I know that I could either store a parallel JSON list with all my IDs or even just store everything in one big JSON object, but then I run into atomicity issues, so if there a way that doesn't need leases I'd prefer that.

Steve Marx

unread,
Sep 8, 2014, 7:26:07 PM9/8/14
to Patrick, websc...@googlegroups.com
Sadly, no. For mostly accidental reasons, the storage system doesn't support anything but setting a key or getting a key.


--
You received this message because you are subscribed to the Google Groups "Webscript.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webscriptio...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Patrick Barrett

unread,
Sep 9, 2014, 11:23:12 AM9/9/14
to Steve Marx, websc...@googlegroups.com
Alright, thanks. I ended up switching to using just a couple JSON strings for everything. It actually ended up making things easier, even with having to add mutexes.

Out of curiosity, how is it possible for the web UI to list all my storage items, but a script can't?

Steve Marx

unread,
Sep 10, 2014, 11:48:42 AM9/10/14
to Patrick Barrett, Steve Marx, websc...@googlegroups.com
We're willing to take the performance hit in the UI to enumerate keys, but we don't want scripts doing that.

Reply all
Reply to author
Forward
0 new messages