mongodb topic in rails


I use mongoid for rails application and I try to do @users = User.where("first_name = ? OR last_name = ? OR type = ?", firstname, lastname, usertype)

but I am getting error but when i put: @users = User.where(:first_name => firstname, :last_name => lastname, :type => usertype).all

the program run successfully but i need OR to execute in mongodb Also I need sql LIKE to execute in mongodb

I have learned the raw code of mongodb but I need a help for Rails query

Could anyone help me ? Thanks in Advance


Reading the documentation usually helps:

Especially the "Model.any_of | Criteria#any_of" section seems to cover your case.

Best regards

Peter De Berdt