Mongoid finders not working?

后端 未结 3 1382
無奈伤痛
無奈伤痛 2021-01-31 03:31

I have set up a rails3+mongoid application and when I open the rails console, none of the finders seem to work - http://d.pr/FNzC

User.all
User.find(:all, :condi         


        
3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-31 04:11

    Try this:

        User.all.first        
        User.find(:first, :conditions => {:first_name => 'John'})    
        User.where(:first_name => 'John').first
    

提交回复
热议问题