Could you please help me find out how to include the mongo collection name to a QueryDsl
query?
Now I can achieve the functionality I want with mongoTemplate
like below:
boolean emailExists(String email) {
Query query = new Query(Criteria.where(Account.EMAIL).is(email));
return mongoTemplate.count(query, "accountMethod") > 0;
}
But I want to do something like this:
boolean emailExists(String email) {
QAccountMethod accountMethod = new QAccountMethod("accountMethod"); //<---Do I need this?
final BooleanExpression query = QAccount.account.email.eq(email);
// return mongoTemplate.count(query, COLLECTION_NAME) > 0;
}
And I guess instead of using
return mongoTemplate.count(query, COLLECTION_NAME) > 0;
use a repository method?
I was thinking something like that? :
boolean existsAccountByEmail(BooleanExpression query, String collectionName);
that results to this:
boolean emailExists(String email) {
final BooleanExpression query = QAccount.account.email.eq(email);
// return mongoTemplate.count(query, COLLECTION_NAME) > 0;
return accountRepository.existsAccountByEmail(query, COLLECTION_NAME);
}
Displaying Dynamic placeholder content on Textbox in ReactJS
Extracting Parameters from Redirect URI - QuickBooks API / Python
How to check if a function is running in worker thread in node?
How to take column from two table in whereExists clause in laravel 5.5
Cannot publish new release to Google Play because of Sensitive app permissions
I'm trying to sort an array of string that sometimes contain numbers
Update: by redirecting stderr from php exec, I can now see that running maxima produces a segmentation fault, increasing the likelihood that this is in fact a bug
Want to improve this question? Update the question so it focuses on one problem only by editing this post
I have here a simple program that displays random images that are in order, with two buttons that enable you to switch from an ascending order and then descending orderNow, I want to implement a random button that will display a random image of the selection...