The query attribute of the converted N1QLQuery from DocumentQuery conversion isn't following the N1QL Escaped Identifiers spec that requires that backticks " ` " be surrounding the escaped identifiers. Without that, the queries aren't performing as expected against the Couchbase database;
JNoSQL Version
1.0.0-SNAPSHOT
Steps To Reproduce
Start a Couchbase instance in a docker container:
docker run -d --name couchbase-instance -p 8091-8094:8091-8094 -p 11210:11210 couchbase
Access the http://localhost:8091 to access the web console:
After start it, click in Setup New Cluster button:
Setup a sample cluster like the image below:
Setting up the cluster name and the administrator password...
And click on the "Finish With Defaults" button to finalize the wizard.
Click on the Buckets left menu and click on the "ADD BUCKET" to create the heroes bucket like below:
After the heroes bucket creation, click on the "Scopes & Collections" link to access the scopes and collections view and then click on "Add collection" in order to create the Hero collection like below:
Click on the _default scope to expand the window then you will be able to see the Hero collection in the table:
Click on the "Documents" link to open the document list view:
Add a document to the created collection by clicking on the "ADD DOCUMENT":
Click on the Query left menu in order to access the Query view, then perform the following query to create a required index:
CREATE PRIMARY INDEX ON `heroes`.`_default`.`Hero`
Then perform the following query:
select * from heroes._default.Hero WHERE 'age' = 34
It's expected to return the stored document, but no documents are retrieved.
Execute again the query surrounding the age identifier with backticks then the expected stored data will be retrieved.
And more, if we execute again the query by letting the age identifier alone it'll work too. I think that it's better to explicitly surround the identifiers with backticks for better visualization purposes;
Expected Results
It's expected the query attribute of N1QLQuery converted from DocumentQuery objects has the identifiers surrounded by backticks in order to about undesired querying behavior.
Which JNoSQL project the issue refers to?
JNoSQL Databases
Bug description
The
query
attribute of the convertedN1QLQuery
fromDocumentQuery
conversion isn't following the N1QL Escaped Identifiers spec that requires that backticks " ` " be surrounding the escaped identifiers. Without that, the queries aren't performing as expected against the Couchbase database;JNoSQL Version
1.0.0-SNAPSHOT
Steps To Reproduce
Start a Couchbase instance in a docker container:
Access the
http://localhost:8091
to access the web console: After start it, click inSetup New Cluster
button:Setup a sample cluster like the image below: Setting up the cluster name and the administrator password... And click on the "Finish With Defaults" button to finalize the wizard.
Click on the
Buckets
left menu and click on the "ADD BUCKET" to create theheroes
bucket like below:After the
heroes
bucket creation, click on the "Scopes & Collections" link to access the scopes and collections view and then click on "Add collection" in order to create theHero
collection like below:Click on the
_default
scope to expand the window then you will be able to see theHero
collection in the table:Add a document to the created collection by clicking on the "ADD DOCUMENT":
Click on the
Query
left menu in order to access the Query view, then perform the following query to create a required index:Then perform the following query:
It's expected to return the stored document, but no documents are retrieved.
Execute again the query surrounding the
age
identifier with backticks then the expected stored data will be retrieved. And more, if we execute again the query by letting theage
identifier alone it'll work too. I think that it's better to explicitly surround the identifiers with backticks for better visualization purposes;Expected Results
It's expected the query attribute of
N1QLQuery
converted fromDocumentQuery
objects has the identifiers surrounded by backticks in order to about undesired querying behavior.Code example, screenshot, or link to a repository
No response