Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

And operator returns empty query #9

Open
jmorakuebler opened this issue Jun 9, 2020 · 1 comment
Open

And operator returns empty query #9

jmorakuebler opened this issue Jun 9, 2020 · 1 comment

Comments

@jmorakuebler
Copy link

Hello everyone, I've been trying to query the database using multiple fields, but the data always returns empty. I already made sure the records meets the conditions separately, but when I use the and: operator, I returns empty. I also check the condition in the mongo shell. If anyone can give me a hand with this, I will appreciate it.

This returns records

query {
  TransaccionalNodes(where: {state: {eq: "3"}}){
    nodes {
      _id
      agente_id
      state
    }
  }
}

# result
{
  "data": {
    "TransaccionalNodes": {
      "nodes": [
        {
          "_id": "5edec4e584c4bffa20a64abb",
          "agente_id": "52",
          "state": "3"
        },
        {
          "_id": "5edec3e984c4bffa20a64aba",
          "agente_id": "52",
          "state": "3"
        },
        {
          "_id": "5edec2f484c4bffa20a64ab9",
          "agente_id": "52",
          "state": "3"
        }
      ]
    }
  }
}

This doesn't

query {
  TransaccionalNodes(where: {and: [{state: {eq: "3"}}, {agente_id: {eq: "52"}}]}){
    nodes {
      _id
      agente_id
      state
    }
  }
}

# result
{
  "data": {
    "TransaccionalNodes": {
      "nodes": []
    }
  }
}
@remorses
Copy link
Owner

remorses commented Jun 9, 2020

Thank you for opening an issue, currently I am reimplementing the engine in golang, I will add your query as a test case to make sure it works

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

No branches or pull requests

2 participants