Hi good people of couchbasia
was looking at some of the object functions but could not find something that could help me obtain the value of a property (in my case the property name is a guid string with ‘-’, therefore is problematic to use as a regular property name)
was wondering about expected behavior, is this a expected/version issue/unknown ?
maybe some thoughts about how can i address the issue ?
FROM ([1]) a LET
x = ([{‘name’: ‘me_prop’, ‘me_prop’: ‘me_prop_val’}]),
y = ({‘name’: ‘me_prop’, ‘me_prop’: ‘me_prop_val’})
SELECT
x[0].name as arr_obj_with_named_prop_as_key,
x[0][x[0].name] as arr_obj_with_variable_as_key,
x[0][‘me_prop’] as arr_obj_with_str_val_as_key,
y.name as obj_with_named_prop_as_key,
y[y.name] as obj_with_variable_as_key,
y[‘me_prop’] as obj_with_str_val_as_key
[
{
“arr_obj_with_named_prop_as_key”: “me_prop”,
“arr_obj_with_str_val_as_key”: null,
“arr_obj_with_variable_as_key”: null,
“obj_with_named_prop_as_key”: “me_prop”,
“obj_with_str_val_as_key”: null,
“obj_with_variable_as_key”: null
}
]
as always, many thanks and keep up with your amazing work