Closed jayaprakashr88 closed 9 years ago
YAQL wrongly identifies "-" in variable name as arithmetic operator minus.
jayaprakash@cloudenablers:~/jp/openstack/src/mistral-templates/openstack$ yaql Yet Another Query Language - command-line query tool Version 0.2.3 Copyright (c) 2013 Mirantis, Inc
No data loaded into context Type '@load data-file.json' to load data
yaql> @load test.json Data from file 'test.json' loaded into context yaql> $ { "name": "test_yaql", "key-name": "openstack" } yaql> $.key-name Execution exception: unsupported operand type(s) for -: 'NoneType' and 'str' yaql>
Is there a way to escape special characters in YAQL ?
YAQL supports retrieval of a value if the keyname has special characters. Just it should be enclosed within single quotes.
yaql> $.'key-name' "openstack" yaql>
YAQL wrongly identifies "-" in variable name as arithmetic operator minus.
jayaprakash@cloudenablers:~/jp/openstack/src/mistral-templates/openstack$ yaql Yet Another Query Language - command-line query tool Version 0.2.3 Copyright (c) 2013 Mirantis, Inc
No data loaded into context Type '@load data-file.json' to load data
yaql> @load test.json Data from file 'test.json' loaded into context yaql> $ { "name": "test_yaql", "key-name": "openstack" } yaql> $.key-name Execution exception: unsupported operand type(s) for -: 'NoneType' and 'str' yaql>
Is there a way to escape special characters in YAQL ?