Wildcard Searches in Mongoid
I'm not sure I'll ever reach the point where I can be described as a fan of Mongo, but discovered today that wildcard searching is very easy with Mongoid:
User.where(email: /STRING_TO_SEARCH_FOR/i)
I'm not sure I'll ever reach the point where I can be described as a fan of Mongo, but discovered today that wildcard searching is very easy with Mongoid:
User.where(email: /STRING_TO_SEARCH_FOR/i)
Looking for help? Hashrocket provides expert Ruby on Rails development. We’ve built hundreds of high–quality Ruby on Rails applications over the past decade. Contact us today and find out how we can help you.