Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Moped::Query#explain overwrites provided hints #84

Closed
@niels

Description

Calling explain on a query containing a hint removes that hint, making it harder to evaluate multiple possible query strategies.

q = User.where(email: "abc").hint(email: 1).query
q.operation.selector
=> {"$query"=>{"email"=>"abc"}, "$hint"=>{"email"=>1}}
q.explain
q.operation.selector
=> {"$query"=>{"email"=>"abc"}, "$orderby"=>{}, "$explain"=>true, "$limit"=>-1}

IMO, the hint should be kept.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions