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

183
Visualizações
How to get cursors from each entity in Google Cloud Datastore query?

I'm working with Google Cloud Datastore in my NodeJS application. When I make a query I want to get the cursors for every entity in the response, however, queries only return the end cursor by default. For example when I make a query like:

const query = datastore
    .createQuery(['EntityType'])
    .limit(2)
    .start(start);
const response = await datastore.runQuery(query);

I get a response that looks something like this:

[
    [
        {
            name: "BLAH",
            age: 21
        },
        {
            name: "BLAH",
            age: 26
        }
    ],
    {
        moreResults: "BLAHBLAHBLAH",
        endCursor: "BLAH2"
    }
]

Is there a way to get the cursor for every entity in the response? For example I want my response to look something like this:

[
    [
        {
            name: "BLAH",
            age: 21,
            cursor: "BLAH1"
        },
        {
            name: "BLAH",
            age: 26,
            cursor: "BLAH2"
        }
    ],
    {
        moreResults: "BLAHBLAHBLAH",
        endCursor: "BLAH2"
    }
]

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

0

Looks like you'll want to access the batch directly from the response. You can trace the responses from IRunQueryResponse to response.batch.entityResults.cursor

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