Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

249
Visualizações
Why using the count function in neo4j with graphql returns two values ​called low and high?

If I execute the following cypher in Neo4j browser returns the expected values

MATCH (n:Document)
RETURN { 
    year: n.year ,
    countdocs : COUNT(n) 
}

Result:

{"countdocs":3,"year":"2018"}    

But If I execute the same cypher in neo4j-graphql

type Query {
    totalActivityOverTime: [JSONObject] @cypher(statement: """
       MATCH (n:Document)
        RETURN { 
         year: n.year ,
         countdocs : COUNT(n) 
       }
    """) 
}

returns :

  {
    "countdocs": {
      "low": 3,
      "high": 0
    },
    "year": "2018"
  },

What means the values ​​low and high?

Thanks!

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I think it depends on the type of countdocs. As far as I know, if you define 'countdocs' as BigInt in neo4j-graphql, it returns a dict with {"low": Int, "high": Int} in order to represent 64bit integers. Define countdocs as Int in the schema should resolve the issue. Int type supports up to 53-bit values

about 4 years ago · Juan Pablo Isaza Relatório

0

Thanks to @Sbunzini and @stdob-- I found the solution:

Schema:

type Activity{
  year: String
  countdocs: Int
}

type Query {
    totalActivityOverTime: [Activity] @cypher(statement: """
       MATCH (n:Document)
        RETURN { 
         year: n.year ,
         countdocs : COUNT(n) 
       }
    """) 
}

GraphQL:

{
  totalActivityOverTime{
    year
    countdocs 
  }
}

Thanks!

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda