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

Ability to query a mongodb view? #354

Open
bryansray opened this issue Mar 3, 2021 · 3 comments
Open

Ability to query a mongodb view? #354

bryansray opened this issue Mar 3, 2021 · 3 comments

Comments

@bryansray
Copy link

I'm attempting to query a mongodb view with

Mongo.find(:mongo, "users-tasks", %{})

... but getting this response back.

Namespace production.users-tasks is a view. Legacy find operations are not supported on views. Only clients which support the find command can be used to query views. 166

Does this driver not support querying views? I wasn't able to find any reference to views anywhere, unfortunately.

@deadtrickster
Copy link
Contributor

Maybe it's related to using OP_QUERY against "user-tasks" vs using OP_QUERY against $cmd (i.e. doing it via commands).

@bryansray
Copy link
Author

bryansray commented Mar 9, 2021

Thank you for the response, @deadtrickster!

Maybe it's related to using OP_QUERY against "user-tasks" vs using OP_QUERY against $cmd (i.e. doing it via commands).

Is this something I can control on my end? Or is it just a feature that this driver doesn't currently support?

@zookzook
Copy link
Contributor

zookzook commented Mar 12, 2021

@bryansray: sorry for the 'advertising' for the https://hex.pm/packages/mongodb_driver. If I remember correctly, I implemented the support for views, because I needed it myself. Maybe you can try it. I just want to help, because I stumbled across the issue.

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

No branches or pull requests

4 participants