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

And operator returns empty query #9

@jmorakuebler

Description

@jmorakuebler

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": []
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions