Rails Mongoid 显示所有使用 "where" 的文档
Rails Mongoid show all documents using "where"
我尝试将值作为参数传递给数组:
控制器:
@users = User.all.page(params[:page]).per(params[:per_page]).order(sort_by => sort_order).where(type: {'$all': ["#{params[:type]}"] })
现在,是否可以使用以下方法从集合中找到所有文档:
.where(type: {'$all': ['something_to_find_all_from type:'] })
?
我尝试将值作为参数传递给数组:
控制器:
@users = User.all.page(params[:page]).per(params[:per_page]).order(sort_by => sort_order).where(type: {'$all': ["#{params[:type]}"] })
现在,是否可以使用以下方法从集合中找到所有文档:
.where(type: {'$all': ['something_to_find_all_from type:'] })
?