Generic MongoRepository Interface for Multiple Documents in MongoDB -
here example on accessing person document mongodb.
public interface personrepository extends mongorepository<person, string> @query("{ 'firstname' : ?0 }") list<person> findbythepersonsfirstname(string firstname); }
if have 5 documents ex: person, family, relation. etc. need create 5 repositories , extend mongorepository or there way achieve in 1 mongorepository.
Comments
Post a Comment