FAQs - Data Type Explorer

Why is the Query tab missing from my Data Type in the Explorer?

The Query tab only shows for a Data Type if at least one field has been indexed for the Data Type. This is because queries can only be performed on indexed fields. For more information on creating indexes for Data Types, see the Game Data page.

Why is the document I just inserted into a Data Type not being returned in my query results?

The queries you submit against the Game Data Service are eventually consistent. This means that newly inserted documents won't always appear straightaway in subsequent queries. You can wait a short time and retry the query and your new document should be returned. If you require the document immediately, you can find the document by id instead of querying for it.

I've submitted a query against a Data Type that I know contains at least one document that matches my query. However, my query is not returning any results. Why is this?

This is most likely an issue with your index setup. When creating an index you must ensure that:

1. The path you set on the index matches where in your JSON structure the field you wish to index is located. For example, suppose your document contains the following:

{"armour":{"head":"iron helm", "torso":"ebony armour", "legs":"iron greaves"}}

You want to add an index for the torso field to be able to query against this field. In this case, the path for the index would need to be armour.torso.

2. The type you specify on the index matches the type stored against the indexed field. For example, if you have a numeric String stored in the document, but have the index defined as a Number type, then your query won't return anything.

Note that the Game Data Service's Index Advisor is very useful in ensuring you don't run into these issues. You can use the Index Advisor under the Indexed Fields section when you open your Data Type at Configurator > Game Data in the platform:

More Information? Please review the Game Data page for more details and examples on setting up Data Type indexes.

Is there any way to get around the limit of 100 results maximum returned when I query my Data Type?

Yes. You can paginate your results. For details on how to do this, see this Tips & Tricks article.