how to use regular expression in mongomodel for rails3
Hello I use rails3+mongodb+mongomodel but I have problem
How to use regular expression search data in mongodb this code in controller
@article = Article.where('开发者_如何学JAVAtitle'=>'/Brown/i')
but it can not found data in database
With mongoid you pass a regexp as is, without quotes. Probably should work similarly for mongomodel:
Article.where('title'=>/Brown/i)
精彩评论