First let me show you the Bucket content.
[
{
“silver-spoon”: 1
},
{
“silver-spoon”: {
“history”: {
“action”: “CREATE”,
“data”: {
“subscriptionFeature”: {
“featureCategory”: “string”,
“featureCode”: “string”,
“featureDescription”: “string”,
“featureName”: “string”
}
},
“roles”: [
“DEVELOPER”
],
“time”: “Mar 13, 2017 7:23:34 AM”,
“type”: “com.fastserve.aawp.aawp.cb.entity.SubscriptionFeatureEntity”,
“user”: “Abhideep”
}
}
},
{
“silver-spoon”: 1
},
{
“silver-spoon”: {
“subscriptionFeature”: {
“featureCategory”: “string”,
“featureCode”: “string”,
“featureDescription”: “string”,
“featureName”: “string”
}
}
}
]
When I first read about N1QL, I have seen a pattern of query like this:
Select XYZ from bucketName.GroupName (Just notice the pattern)
So when I tried this:
select * from 'silver-spoon.subscriptionFeature'
, I was expecting the subscription feature JSON, while what I got was:
[
{
“code”: 12003,
“msg”: “Keyspace not found keyspace silver-spoon.susbcriptionFeature - cause: No bucket named silver-spoon.susbcriptionFeature”,
“query_from_user”: "select * from silver-spoon.susbcriptionFeature
"
}
]
I am 100% sure that I have seen “FROM bucket.ABC” format. I am not sure what it is not working for me. I do not want to query like "FROM ‘bucket’ where type=‘mno’ " style, rather I would like to go like "FROM ‘bucket.mno’ ".
In short, I want to use
select * from 'silver-spoon.subscriptionFeature'
instead of
select * from 'silver-spoon'
WHERE type=‘subscriptionFeature’ , to get all the subscription features.
I am expecting this pattern will make the querying faster.