-
Notifications
You must be signed in to change notification settings - Fork 213
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
Cannot fetch data #19
Comments
You need to enclose $group and $sum in quotes.
…On Thu, 9 Aug 2018, 11:34 yulidai, ***@***.***> wrote:
Query:
db.test.aggregate([{$group : {_id : "$name”, num_tutorial : {$sum : 1}}}])
Error in Response:
{ "message": "Unexpected token $ in JSON at position 3" }
I'm a novice at these things, can you help me what wrong with it?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#19>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AGzx-MlXMXtBLHMCujGgC064MMQRIYA_ks5uPBAkgaJpZM4V1cu2>
.
|
Query: Error in Response |
Thanks for your reply. I changed query to: Then there's no wrong messge. But still not info showed in "Table Panel", but has result when running in mongo-cli |
you need to project the following fields in order for it to show on the panel:
You can check the README for more info on the required fields that the api expects |
@minh0722 Thank you for your patience Here is my data in mongo with command in mongo:
Then the query in panel is:
But still nothing showed in either Graph or Table. Any help will be appreciated, thank you! |
You don't have a column |
Sorry I edited my prev comment |
@minh0722 Thank you, Still nothing after changing, any other problem? |
what's the response from the query? |
target is
response is
|
change the type to timeserie. Table type is not supported |
Result after changing type to timeserie
|
Maybe the reason is caused by time zone(here is china), but when i change time range from "last 6h" to "last 24h". But still nothing to show, i don't know why... T.T |
I dont think that's the problem cause you dont have a "$match" pipeline in your aggregate. But just to try it out add this before "$group": |
No data too. when run in mongo-cli with:
Will get data below:
But with nothing in grafana. Maybe caused by my grafana setting? But datasource test is success. And i rechecked config is same to the document |
did you select the datasource that is above the query box? |
Here is the db config:
And the mongodb is running in local, Datasource testing info is:
|
Yes i did select the mongodb as the datasouce |
Oh my god, the Datasource testing always success even though closing the database. I think is the proxy hide the error, i'll check it... |
check if data source is correctly configured. I had problem with some proxy settings and I had to write the full proxy domain name in mongodb url so you can check that too |
@minh0722 When i change "MongoDB URL" to localhost, the response is different:
response:
|
I think the field time has to be of type Date |
Right, it's ok after changing the type of time, thanks! |
@yulidai How was this problem solved? I have the same problem, I changed the time type to isodate but it doesn't work. |
I am facing same issues - my query is this - and response is - |
Query:
db.test.aggregate([{$group : {_id : "$name”, num_tutorial : {$sum : 1}}}])
Error in Response:
{ "message": "Unexpected token $ in JSON at position 3" }
I'm a novice at these things, can you help me what wrong with it?
The text was updated successfully, but these errors were encountered: