Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

184
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda