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

How to make query with project fields? #14

Open
adil659 opened this issue Nov 17, 2024 · 2 comments
Open

How to make query with project fields? #14

adil659 opened this issue Nov 17, 2024 · 2 comments
Assignees

Comments

@adil659
Copy link

adil659 commented Nov 17, 2024

I finally managed to integrate your plugin with grafana OSS. I was able to make basic queries using the MongoDb Compass way to making queries. I was wondering if there are other query methods it accepts such as the cli way?

I can't seem to show only certain columns when making the query, it gives all of the columns. In MongoDb examples it seems possible by using the Project filter . like so: { item: 1, status: 1, "instock.qty": 1 } . but I'm not sure how I can achieve this using the plugin.

@ludovicm67 ludovicm67 self-assigned this Nov 18, 2024
@ludovicm67
Copy link
Owner

Thank you @adil659 for using the Grafana plugin and for your question!

Regarding the current state, it's returning all entries, but it's possible to only select fields that have a specific value by using {"field": "value"} in the query zone.

The current implementation is doing find operations, and provides the query as the query parameter (first one), see reference here: https://www.mongodb.com/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find

In the future, I might add other fields to allow the user to set the projection, options, and also add support for other methods to query data than find.

@adil659
Copy link
Author

adil659 commented Dec 4, 2024

oh okay, thankyou!

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

2 participants