dynein icon indicating copy to clipboard operation
dynein copied to clipboard

example to update item's attribute as string

Open zxkane opened this issue 3 years ago • 1 comments

I can update an existing item to set/add attribute as boolean or number.

# working when set the `attr` as boolean or number
dy upd key --set "attr = false"
dy upd key --set "attr = 100"

When set an attribute as string, I got below error. No idea how making it work.

dy upd key --set "attr = 'ssss'"
thread 'main' panicked at 'failed to parse right hand object ''ssss'' into AttributeValue.', src/data.rs:553:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

dy upd key --set "attr = ssss"  
thread 'main' panicked at 'failed to parse right hand object 'ssss' into AttributeValue.', src/data.rs:553:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

zxkane avatar Jan 22 '22 10:01 zxkane

+1

fab-mindflow avatar May 12 '22 13:05 fab-mindflow

Dynein does not support string by single quote in the --set option. Instead, you can use dy upd key --set 'attr = "ssss"'. I understand many programming languages support single and double quote strings. Therefore, I want to treat this issue as a feature request.

StoneDot avatar Jun 02 '23 14:06 StoneDot

This issue has been addressed in #132. You can now use both single-quoted strings and double-quoted strings. We have plans to release it in v0.3.0.

StoneDot avatar Jun 30 '23 16:06 StoneDot