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

[M3DB] HTTP Json API of Query returns empty results when Query JSON Body is wrong #2473

Closed
asafm opened this issue Jul 21, 2020 · 1 comment · Fixed by #2490
Closed

[M3DB] HTTP Json API of Query returns empty results when Query JSON Body is wrong #2473

asafm opened this issue Jul 21, 2020 · 1 comment · Fixed by #2490
Assignees
Labels
area:db All issues pertaining to dbnode C: API P: Low

Comments

@asafm
Copy link
Contributor

asafm commented Jul 21, 2020

  1. Write tagged data point, say to namespace default, with tag city: new-york
  2. Read it using 9003:/query to dbnode, having a range which includes the timestamp inserted in step 1.
{
  "namespace": "default",
  "query": {
    "term": {
      "field": "city",
      "value": "new_york"
    }
  },
  "rangeStart": 0,
  "rangeEnd": 1595325840
}

Notice the error in the query (term was replaced with value).

Response: 200 OK, with

{
    "results": [],
    "exhaustive": true
}

Expected: 400 Bad Request with error stating term is required in query.term

@robskillington
Copy link
Collaborator

robskillington commented Jul 27, 2020

Thanks for filing this @asafm, we've merged a fix for returning an error on an unknown field being used with these raw DB APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:db All issues pertaining to dbnode C: API P: Low
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants