1

I'm trying to run GQL query on my datastore. Something like this:

SELECT * FROM products WHERE model = @model AND date >= @date

But there's error like:

You need an index to execute this query.

In google api documentation i found nothing about indexes for nodejs. How i can set this indexes?

1 Answer 1

2

Unfortunatly as of today the gcd tool doesn't support automatic index generation for languages using the JSON interface (like Node.js or Ruby).

A workaround is the manually define your index in <your-dataset-directory>/WEB-INF/datastore-indexes.xml

<?xml version="1.0" encoding="utf-8"?>
<datastore-indexes
  autoGenerate="true">
    <datastore-index kind="product" ancestor="false">
        <property name="model" direction="asc" />
        <property name="date" direction="asc" />
    </datastore-index>
</datastore-indexes>

See the Index Configuration section of the datastore documentation for more details.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.