Details
Description
Original Query:
SELECT name FROM default_shadow WHERE ANY x IN ["Support","Management"] SATISFIES job_title = x END ORDER BY name;
|
This works fine in N1QL but cbas throws an error.
If we refer job_title with dataset name it works fine, without that query parser considers it as string.
Modified Query:
SELECT name FROM default_shadow WHERE ANY x IN ["Support","Management"] SATISFIES default_shadow.job_title = x END ORDER BY name;
|
Here job_title is of type String in the document.
Another example is:
SELECT name,email FROM default_shadow WHERE (ANY skill IN default_shadow.skills SATISFIES skill = 'skill2010' END)
|
Here skills is an json array and comparison is happening between two strings as it was in the previous case and it is working properly.
Sample Document:
{
|
"mutated": 0,
|
"test_rate": 11.11,
|
"join_mo": 11,
|
"join_day": 21,
|
"skills": [
|
"skill2010",
|
"skill2011"
|
],
|
"hikes": [
|
20,
|
10,
|
15
|
],
|
"permanent": 1,
|
"tasks_points": {
|
"task1": 1,
|
"task2": 1
|
},
|
"join_yr": 2010,
|
"name": "employee-21",
|
"_id": "query-testemployee58360.6484454-0",
|
"job_title": "Support",
|
"VMs": [
|
{
|
"name": "vm_11",
|
"memory": 11,
|
"os": "ubuntu",
|
"RAM": 11
|
},
|
{
|
"name": "vm_12",
|
"memory": 11,
|
"os": "windows",
|
"RAM": 11
|
}
|
],
|
"email": "21-mail@couchbase.com"
|
}
|