-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
Hi. I'm trying a search in products nested model, like this:
current_user.company.products.where(name: "/._#
{params[:name]}._/").limit(5)
And that query is not logged at all. All it shows is:
Processing by AjaxController#products as JSON
Parameters:
MOPED: 127.0.0.1:27017 QUERY database=stock_system collection=users selector={"$query"=>
{"_id"=>BSON::ObjectId('532a31376a756e29c9000000')}, "$orderby"=>{:_id=>1}} flags=[] limit=-1 skip=0 batch_size=nil fields=nil runtime: 0.5320ms
MOPED: 127.0.0.1:27017 QUERY database=stock_system collection=companies selector={"$query"=>
, "$orderby"=>{:_id=>1}} flags=[] limit=-1 skip=0 batch_size=nil fields=nil runtime: 0.8050ms
Completed 200 OK in 4ms (Views: 0.2ms)
Which is the query for the current user and the company, but not the products embedded in the company. I need to see the product raw query to find out what's the problem with that query.
I'm using mongoid version 4.0.0.beta1.
I also tried mongo db.system.profile.find() and it does not show the query on products either, but the app is returning the products json, so the query was made. I can't understand what is happening. I appreciate any help thanks.