# Google Cloud Datastore Retrieval

**URL:** https://community.particle.io/t/google-cloud-datastore-retrieval/56872
**Category:** Cloud
**Created:** [July 2, 2020, 10:20pm UTC](https://community.particle.io/t/google-cloud-datastore-retrieval/56872 "2020-07-02T22:20:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MikeP171](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@MikeP171](https://community.particle.io/u/MikeP171)
#### Post date: [July 2, 2020, 10:20pm UTC](https://community.particle.io/t/google-cloud-datastore-retrieval/56872/1 "2020-07-02T22:20:32Z")

</div>

Hi I am following this tutorial and have successfully validated that my data has reached the Google Cloud pub/sub and Datastore. Tutorial found here:  
[https://docs.particle.io/tutorials/integrations/google-cloud-platform/](https://docs.particle.io/tutorials/integrations/google-cloud-platform/)

However I am also interested in writing a nodeJS script/ server file to view the contents of the Datastore. I have successfully ran a JS function with a for loop and console.log() statements however when I substitute my parameters and query the server, this is where I have issues. My query does not print anything to the screen, aka is blank but I know there is 83 entries in the database. I am also trying to print this to a website using a homegrown hbs website. I used this as a template but was unsuccessful:

> **[@google-cloud/datastore](https://www.npmjs.com/package/@google-cloud/datastore)**
>
> Cloud Datastore Client Library for Node.js

Are there any recommendations that might be helpful? Thanks. Mike

---

<div class="post-metadata">

### Author: ![MikeP171](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@MikeP171](https://community.particle.io/u/MikeP171)
#### Post date: [July 6, 2020, 2:18am UTC](https://community.particle.io/t/google-cloud-datastore-retrieval/56872/2 "2020-07-06T02:18:42Z")

</div>

@Nrobinson2000 Are you familiar with NodeJS on Google cloud at all?

Update: I am now getting results however they are not the right results. I need to access everything but the Symbol(KEY) shown below. Thoughts? Thanks.

```auto
async function listmyData() {
  const query = datastore.createQuery('ParticleEvent').order('published_at')
    //.select(' __key__') // only gives key
    .limit(3)
    .order('published_at');
    //.filter(' __key__', '>', datastore.key(['Task', 'someTask']))
  //console.log(query);
  const [eaPoint] = await datastore.runQuery(query);
  
    for (const taskmike of eaPoint) {
         const taskKey = taskmike[datastore.KEY];
         console.log(taskKey.id, taskmike); // send output from defined query.
     }
    
    console.log(colors.blue('End of my data'))
}

```

results:

```auto
5632499082330112 { data: <Buffer 74 65 73 74 2d 65 76 65 6e 74>,
  gc_pub_sub_id: '439120639426144',
  event: 'my_event',
  published_at: '2019-11-01T14:30:36.335Z',
  device_id: 'api',
  [Symbol(KEY)]:
   Key {
     namespace: undefined,
     id: '5632499082330112',
     kind: 'ParticleEvent',
     path: [Getter] } }
End of my data

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/6/4/64635adccc35238caa19e9b553ec3e98b163d026.png) [@system](https://community.particle.io/u/system)
#### Post date: [January 4, 2021, 2:31pm UTC](https://community.particle.io/t/google-cloud-datastore-retrieval/56872/3 "2021-01-04T14:31:54Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
