문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top