0

I am trying to build a search based on names. I am using newbie mongoid user. I want a query in which if i pass "A" it would return me all the names starting with "A".

1 Answer 1

2

Just do:

User.where(:name => /^A/)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.