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
{{ message }}
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
I am trying to add a list of strings into the Cloudflare KV Store as json via cloudworker with this command cloudflare --kv-set CONFIG.SAMPLE_CONFIG=["92887"]. When I do this the quotes are stripped so that when I read the Config via CONFIG.get('SAMPLE_CONFIG', 'json'); I am returned [92887] which is a list of ints not strings. I tried escaping the quotes and that didn't work also.
I also tried cloudflare --kv-set CONFIG.SAMPLE_CONFIG=["test"] putting in an actual string that cannot be interpreted as an integer. When doing this reading the config via CONFIG.get('SAMPLE_CONFIG', 'json'); fails because the JSON is not parsable, and reading the value as text via CONFIG.get('SAMPLE_CONFIG', 'json'); returns "[test]" as one string which is not valid json because test is not in quotes.
Is it possible to support list of strings as a valid input into cloudflare KV Store.
The text was updated successfully, but these errors were encountered:
SyntaxError: Unexpected token e in JSON at position 2
at JSON.parse (<anonymous>)
at KeyValueStore.get (*s/@dollarshaveclub/cloudworker/lib/kv.js:49:37)
at evalmachine.<anonymous>:3131:44
at Generator.next (<anonymous>)
at evalmachine.<anonymous>:2980:71
at new Promise (<anonymous>)
at __awaiter (evalmachine.<anonymous>:2976:12)
at proxyHomesPage (evalmachine.<anonymous>:3124:12)
at Object.handler (evalmachine.<anonymous>:3511:25)
at evalmachine.<anonymous>:5116:51
This is the JSON Parse error when I try and call CONFIG.get('SAMPLE_CONFIG', 'json') when SAMPLE_CONFIG is set via cloudflare --kv-set CONFIG.SAMPLE_CONFIG=[\"test\"] the quotes around test I suspect are just getting stripped
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am trying to add a list of strings into the Cloudflare KV Store as json via cloudworker with this command
cloudflare --kv-set CONFIG.SAMPLE_CONFIG=["92887"]
. When I do this the quotes are stripped so that when I read the Config viaCONFIG.get('SAMPLE_CONFIG', 'json');
I am returned [92887] which is a list of ints not strings. I tried escaping the quotes and that didn't work also.I also tried
cloudflare --kv-set CONFIG.SAMPLE_CONFIG=["test"]
putting in an actual string that cannot be interpreted as an integer. When doing this reading the config viaCONFIG.get('SAMPLE_CONFIG', 'json');
fails because the JSON is not parsable, and reading the value as text viaCONFIG.get('SAMPLE_CONFIG', 'json');
returns "[test]" as one string which is not valid json because test is not in quotes.Is it possible to support list of strings as a valid input into cloudflare KV Store.
The text was updated successfully, but these errors were encountered: