ruby on rails - Query MongoDB with length criteria -


i have several documents in mongodb collection, field 'name' (which string).

how can perform queries 7 <= name.length <= 14

you can use javascript expression.

user.where("this.name.length >= 7 && this.name.length <= 14") 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

java - where to store the user credentials in an enterprise application(EAI)? -

openxml - Programmatically format a date in an excel sheet using Office Open Xml SDK -