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 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -