We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
haal opened DATACOUCH-615 and commented
Using CouchbaseTemplate to remove data by specified query
couchbaseTemplate.removeByQuery(Some.class).matching(query).all();
will always remove all data and ignore query sent in matching part. Same is true for ReactiveCouchbaseTemplate. Tested with v4.0.4 using Java 11.
Example of JUnit test (in class CouchbaseTemplateQueryIntegrationTests):
@Test void removeByQueryMatching() { User user1 = new User(UUID.randomUUID().toString(), "user1", "user1"); User user2 = new User(UUID.randomUUID().toString(), "user2", "user2"); User specialUser = new User(UUID.randomUUID().toString(), "special", "special"); couchbaseTemplate.upsertById(User.class).all(Arrays.asList(user1, user2, specialUser)); assertTrue(couchbaseTemplate.existsById().one(user1.getId())); assertTrue(couchbaseTemplate.existsById().one(user2.getId())); assertTrue(couchbaseTemplate.existsById().one(specialUser.getId())); Query nonSpecialUsers = new Query(QueryCriteria.where("firstname").notLike("special")); couchbaseTemplate.removeByQuery(User.class).consistentWith(QueryScanConsistency.REQUEST_PLUS) .matching(nonSpecialUsers) .all(); assertNull(couchbaseTemplate.findById(User.class).one(user1.getId())); assertNull(couchbaseTemplate.findById(User.class).one(user2.getId())); assertNotNull(couchbaseTemplate.findById(User.class).one(specialUser.getId())); //this assert because all data is deleted }
Affects: 4.0.4 (Neumann SR4)
Referenced from: pull request #264
Backported to: 4.0.5 (Neumann SR5)
The text was updated successfully, but these errors were encountered:
haal commented
Here is PR: #264
Sorry, something went wrong.
mikereiche
No branches or pull requests
haal opened DATACOUCH-615 and commented
Using CouchbaseTemplate to remove data by specified query
will always remove all data and ignore query sent in matching part. Same is true for ReactiveCouchbaseTemplate.
Tested with v4.0.4 using Java 11.
Example of JUnit test (in class CouchbaseTemplateQueryIntegrationTests):
Affects: 4.0.4 (Neumann SR4)
Referenced from: pull request #264
Backported to: 4.0.5 (Neumann SR5)
The text was updated successfully, but these errors were encountered: