question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

QueryCriteria.where() adds backticks to ALL keys, breaks keys that use META()

See original GitHub issue

For example:

import static org.springframework.data.couchbase.core.query.N1QLExpression.*;
...
QueryCriteria criteria = QueryCriteria.where(path(meta(escapedBucket(getCouchbaseOperations().getBucketName())), "cas").toString()).eq(version);

produces a query like so:

(`META(`YS_Apps`).cas` = 1611287177404088320)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mikereichecommented, Feb 2, 2021

Adding support for a where(N1qlExpression) method. This would require changing the “key” of QueryCriteria from a String to a N1QLExpression.

Unrelated to the where(N1lqExpression) issue - the CAS in n1ql should always be treated as a string, not a number. https://issues.couchbase.com/browse/MB-24464 https://issues.couchbase.com/browse/MB-44048

0reactions
aaronjwhitesidecommented, Feb 2, 2021

OK, you didn’t mention N1QLExpression in your initial response, so I was confused 😃

So what are the next steps?

Read more comments on GitHub >

github_iconTop Results From Across the Web

findById...AndXXX method derived query generates wrong ...
AndXXX method derived query generates wrong statement #1072 · QueryCriteria.where() adds backticks to ALL keys, breaks keys that use META() #1066.
Read more >
How do I put backticks in a column name called key for ...
1 Answer 1 · For mysql, I don't think that will work. In the end I got it solved by doing column="'key'". –...
Read more >
Content Management Interoperability Services (CMIS) Version ...
A list of all property data types that can be used by a client to create or update an object-type definition. See sections...
Read more >
HIBERNATE - Relational Persistence for Idiomatic Java
Here, we are using a Hibernate Query Language (HQL) query to load all existing Event objects from the database. Hibernate will generate the ......
Read more >
Remap key to two modifers or use meta shortcuts in terminal ...
So I am using xmodmap. Right now caps lock is mapped to meta (hyper_L) which is assigned to Mod4 (along with Super). I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found