insert into default values ("k01",{"a":5, "b":null});
|
create index ix1 on default(a,[a,b,c]);
|
select a, [a,b,c] from default where a = 5;
|
Above query is covered.
select a, [a,b,c] from default where a = 5;
|
{
|
"requestID": "cb21d244-8e31-435a-9425-1778a26b0f55",
|
"signature": {
|
"$1": "array",
|
"a": "json"
|
},
|
"results": [
|
{
|
"$1": [
|
5,
|
null,
|
"~[]{}falsenilNA~"
|
],
|
"a": 5
|
}
|
],
|
"status": "success",
|
"metrics": {
|
"elapsedTime": "1.541289ms",
|
"executionTime": "1.519247ms",
|
"resultCount": 1,
|
"resultSize": 141
|
}
|
}
|
If look the output 3rd element of array is given as string of missing value
That is in correct. It can't convert to string. As MISSING can't be displayed inside array because no such thing in JSON and can't skip element and add another element array. N1QL keeps it as MISSING type and while sending to user or display time converts that to NULL. Indexer should send to as MISSING type not a string type.
N1QL USE KEYS
select a, [a,b,c] from default USE KEYS ["k01"] where a = 5 ;
|
{
|
"requestID": "17dfe29f-8ab1-441d-93d5-4710facf3b6a",
|
"signature": {
|
"$1": "array",
|
"a": "json"
|
},
|
"results": [
|
{
|
"$1": [
|
5,
|
null,
|
null
|
],
|
"a": 5
|
}
|
],
|
"status": "success",
|
"metrics": {
|
"elapsedTime": "1.565704ms",
|
"executionTime": "1.543396ms",
|
"resultCount": 1,
|
"resultSize": 127
|
}
|
}
|