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

Cannot fetch data #42

Open
comataani opened this issue Jan 29, 2019 · 2 comments
Open

Cannot fetch data #42

comataani opened this issue Jan 29, 2019 · 2 comments

Comments

@comataani
Copy link

Query
db.status.aggregate(
[ { $match: { api: "api details" } }, { "$group": { _id: "$environment", count: { "$sum": 1 } } } ]
);

error in response:
"Unexpected token $ in JSON at position 8"

can you help me whats wrong in this

@vladostp
Copy link

vladostp commented Feb 1, 2019

Hi comataani,

Try to execute this query
db.status.aggregate(
[ { "$match": { "api": "api details" } }, { "$group": { "_id": "$environment", "count": { "$sum": 1 } } } ]
);

@comataani
Copy link
Author

Not able to execute that query even from mongo client.
but i tried this query i am able to execute it from mongo db but in grafanna i am getting the following error
db.status.aggregate(
{"$group" : {"_id": {"environment":"$environment"}, "count": { "$sum": 1 } } },
{"$match": {"count" : {"$gt": 10} } },
{"$project": {"environment":1} }
)

capture50

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