Skip to content

Passing more query to raw_query  #190

Open
@Alir3z4

Description

@Alir3z4

raw_query is fine to pass a query as spec to it, but noting there for fields or other.

Like:

CoolModel.objects.raw_query({age : {'$gt': 13}})

but if we need to have fields or for example having score as $meta field on the result when doing full-text search it won't work at all, since passing fields to pymongo find should be second parameter and can't be combined with the spec.

I know defining extra field on the result would cause failure in returning QuerySet since the model we're running query on it doesn't have that new field that has been defined by $meta, but is it the only reason to not able pass extra parameters to raw_query? because it can be done via defining a proxy model where we can have any $meta field defined on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions