java - Spring data mongo use OR in Query -


let´s see if can this.

i want use repository of spring data mongodb, , want use query annotation filter find value a=10 or a=20

  @query("{a: 10, a:20}")   findbyid(int id); 

obiously "," try make and, , need or.

any idea please?

i think might work

@query("{'$or':[ {'a':10}, {'b':20} ] }") 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -