sradforth
sradforth

Reputation: 2186

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)
        {
...
    }

Upvotes: 4

Views: 1948

Answers (2)

Donn Lee
Donn Lee

Reputation: 3149

Looks like they have added Ruby, but still no Node.js :(

Fortunately, I needed the equivalent of GQL CONTAINS and .filter('foo', '=', 'bar') (on a value that is an array) seems to be working ok.

GQL added Ruby

Upvotes: 1

Justin Tamblyn
Justin Tamblyn

Reputation: 733

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."

Upvotes: 4

Related Questions