@DBref The document association, when queried by that type, add the field name of the associated table to the field name, as follows:
Criteria.where ("BlogGroup. $id"),
$id represents the OID field of the associated table.
OR and and union queries
such as the query (a = 1 and b = 2) or (A = 3 and b =4), or the number of uncertainties,
Then a criteria array is defined, the condition group is entered into the array, and the array is assigned to the Orcriteria method.
@Override
Public list<blog> Find (list<groupattention> groupattentions) {
Query query = new query ();
criteria = new criteria ();
criteria[] CriteriaList = new criteria[groupattentions.size ()];
for (int i=0;i<groupattentions.size (); i++) {
Criteria Criteriaand = new criteria ();
Criteriaand.andoperator (Criteria.where ("BlogGroup. $id"). Is (new ObjectId (Groupattentions.get (i). Getgroupid ())). and ("Bloglevel"). GTE (Groupattentions.get (i). Getgrouplevel ()));
Criterialist[i] = Criteriaand;
}
Criteria.oroperator (criterialist);
Query.addcriteria (criteria);
return mongotemplatedatabase.find (query, Blog.class);
}
Spring DATA MongoDB @DBref query, OR and and Union queries