java - Spring Data Query with Array of strings using @Query annotation -


i'm using spring repository query mongodb. have function in repo 1 below searches key-value pair in db.

@query("{ '?0' : { $eq: ?1 } }") public page<gsjsonstore> matchjson(string term, string value, pageable pageable); 

i have modify query accept array of strings below :

public page<gsjsonstore> matchjson(string[] term, string[] value, pageable pageable); 

how modify query search multiple k-v pairs using and/or condition?

like :

{'term[1]' : {$eq : value[1]} , 'term[2]' : {$eq : value[2]} and.....} 

thanks!


Comments