max not working on scope with any_in + sort

XMLWordPrintableJSON

    • None
    • None
    • None
    • None
    • None
    • None
    • None

      scope :sent, any_in(state: [:sent]).desc(:sent_at)
      Order.sent.max(:number)

      This query raises Moped error:

      v3.0.23 - failed with error 15876: "could not create cursor
      v3.1.2 - failed with error "no such cmd: aggregate"

      This one works:

      Order.any_in(state: [:sent]).max(:number) # => 88.0

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

                Created:
                Updated:
                Resolved: