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

Add :max_time_ms as an arbitrary option on Criteria

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Blocker - P1 Blocker - P1
    • 6.0.0
    • Affects Version/s: None
    • Component/s: None
    • None

      I tried to call #extras with $maxTimeMS, but it doesn't perform the query with that extra mongodb operator.

      [1] pry(main)> Yoolk::Mongo::Listing.where(name: "1").extras("$maxTimeMS" => 10000)
      => #<Mongoid::Criteria
        selector: {"name"=>"1"}
        options:  {"$maxTimeMS"=>10000}
        class:    Yoolk::Mongo::Listing
        embedded: false>
      [2] pry(main)> Yoolk::Mongo::Listing.where(name: "1").extras("$maxTimeMS" => 10000).to_a
      

      It takes ages to finish. What is the correct way to do?

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            chamnap chamnap
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: