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

Add :max_time_ms as an arbitrary option on Criteria

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Blocker - P1
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0.0
    • Component/s: None
    • Labels:
      None
    • Sprint:
      Ruby Sprint 37

      Description

      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?

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: