Issues with create dataset

Hi,

I have tried to run the following command to create a dataset using the beer-sample:

CREATE DATASET beerSample_Geo ON beer-sample WHERE geo.accuracy = “ROOFTOP”;

The command was run successfully and I have also run “CONNECT LINK Local;” command successfully. However, when I run the following:

/////////
SELECT VALUE count(*) FROM beerSample_Geo;

///////

0 is returned for the count, that means, the dataset beerSample_Geo does not contain any documents. However, the beer-sample bucket does contain document like the following:

/////////////
{
“address”: [
“407 Radam, F200”
],
“city”: “Austin”,
“code”: “78745”,
“country”: “United States”,
“description”: “(512) Brewing Company is a microbrewery located in the heart of Austin that brews for the community using as many local, domestic and organic ingredients as possible.”,
“geo”: {
“accuracy”: “ROOFTOP”,
“lat”: 30.2234,
“lon”: -97.7697
},
“name”: “(512) Brewing Company”,
“phone”: “512.707.2337”,
“state”: “Texas”,
“type”: “brewery”,
“updated”: “2010-07-22 20:00:20”,
“website”: “http://512brewing.com/
}

////////////////

Do you know what may cause the problem? Does the “CREATE DATASET” command have problem with the specified field geo.accuracy?

Hi @jessyang,
It looks like you are escaping the fields access expression (geo.accuracy) in the WHERE condition as a single field name called (geo.accuracy). This would translate to: find matching docs with a field named “geo.accuracy” with the value “ROOFTOP”. If you would like to use the escape syntax, you need to escape each field individually like this:
CREATE DATASET beerSample_Geo ON `beer-sample` WHERE `geo`.`accuracy` = “ROOFTOP”;
In your case however, you don’t need to escape the field names since none of them is a special keyword, so even the following should work:
CREATE DATASET beerSample_Geo ON `beer-sample` WHERE geo.accuracy = “ROOFTOP”;
I tried the above statement and I got a count of 500. Please let me know if it doesn’t work for you.

Thanks. I give it a try and your suggestion solved the issues.