I have a a document which is having references of two other document. I have to query in the basis of id of UserLogin and shopmaster. How I can achieve this. Please suggest how to query.
@Id
private String userShopAssociationId;
@DBRef
private UserLogin userLogin;
@DBRef
private ShopMaster shopMaster;
Query query = new Query();
query.addCriteria(Criteria.where("userLogin.$id").is(userShopAssociationForm.getUserLoginId()));
query.addCriteria(Criteria.where("shopMaster.$id").is(userShopAssociationForm.getShopMasterId());