Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-3594

Not able to see embedded models queries.

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 12_01_17
    • Component/s: None
    • Labels:

      Description

      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:

      {"name"=>"meu", "page"=>"1", "_"=>"1397053974337"}

      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"=>

      {"_id"=>BSON::ObjectId('532a31376a756e29c9020000')}

      , "$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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            juniorjp juniorjp
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: