N1QL Workbench does not return results

query

#1

We are using the Couchbase 4.5 Server Edition. Whenever we fire a SELECT query on the bucket, we get the following JSON as output

{ "results": [], "metrics": { "elapsedTime": "929.786µs", "executionTime": "886.295µs", "resultCount": 0, "resultSize": 0 } }

Is this a bug with Couchbase? Any pointers will be helpful.

thanks,
Neelesh


#2

Hey Neelesh,

It looks like your query is returning correctly, just that no documents matched it. Are you able to share the query you’re running? Do you get results from a simple query like SELECT * FROM my_bucket;?


#3

Hi JFlat,

No, I am not getting any results out of the simple SELECT query as well. Also, I tried fetching records with a specific attribute value that exists in some documents in the bucket. Even those results are not returned.

thanks,
Neelesh


#4

Huh, that does sound strange. Sorry for the simple questions, but could you check a few things:

If you can get screenshots of any of this (as much as possible), that’d be a big help!


#5

Hi JFlat,

I could get the result by using the USE KEYS clause. However, without the said clause, I am not able to retrieve the results. Can you suggest some examples with USE KEYS that can be used for querying multiple documents ?

thanks,
Neelesh


#6

@neeleshkumar_mannur what kind of indexes do you have created on your bucket?


#7

@daschl, I have created PRIMARY INDEXES on the buckets.


#8

@neeleshkumar_mannur can you show us the query you run as well as the output with an EXPLAIN before?


#9

@daschl
PFB the output of the query EXPLAIN SELECT * FROM ``raw_data`` USE KEYS "1";

[
{
“plan”: {
"#operator": “Sequence”,
"~children": [
{
"#operator": “KeyScan”,
“keys”: ““1"”
},
{
#operator": “Parallel”,
“maxParallelism”: 1,
"~child": {
"#operator": “Sequence”,
"~children": [
{
"#operator": “Fetch”,
“keyspace”: “raw_data”,
“namespace”: “default”
},
{
"#operator": “InitialProject”,
“result_terms”: [
{
“expr”: “self”,
“star”: true
}
]
},
{
"#operator": “FinalProject”
}
]
}
}
]
},
“text”: “SELECT * FROM raw_data USE KEYS “1”;”
}
]

Please ignore no space in the above query.

thanks,
Neelesh


#10

This same issue has been happening to me as well since I upgraded to 4.5.0 instead of the 4.5.0 developer preview.

I have records in my bucket, but I cannot query them at all using n1ql.


#11

Hey codestar - Have you already done the troubleshooting steps above, that is you created a primary index and verified that you can query using primary keys? I’m assuming that you have already verified that the index and query services are both running.

If that doesn’t work, please create a new thread and describe what you’re specifically trying to do and what happens.
Best,
-Will


#12

Any update guys…? I am still not able to query the datasets…