Search code examples
node.jsgoogle-cloud-datastoregoogle-cloud-platformgql

GQL with node.js


Is there a working example of using Google Datastore GQL in Node.js?

The examples in the documentation contain a .execute function that doesn't appear to exist.

https://cloud.google.com/datastore/docs/concepts/gql

I therefore tried using the regular callback approach but the GQL statement isn't picked up. I've tried using gql_query and gqlQuery as the resource parameter name but to no avail.

store.datasets.runQuery(
        {
            "resource":
            {
                "gqlQuery":
                {
                    "queryString":"SELECT * from Messages LIMIT 50",
                    "allowLiterals":true
                }
            }

        }, 
        function(err, result, endCursor, apiResponse)
        {
...
    }

Solution

  • I may have found the answer:

    enter image description here

    The docs indicate that "... Google Cloud Client Library for Java supports GQL, but other Google Cloud client libraries do not."