Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing more query to raw_query #190

Open
Alir3z4 opened this issue Jun 28, 2014 · 0 comments
Open

Passing more query to raw_query #190

Alir3z4 opened this issue Jun 28, 2014 · 0 comments

Comments

@Alir3z4
Copy link

Alir3z4 commented Jun 28, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant