Sign In Register

How can we help you today?

Start a new topic
Answered

Ensure Indexes

So far, I've found that the only way to create indexes in my database is to have the line "metaCollection().ensureIndex()" fire in my cloud code.


Is there a "correct" place to do this, rather than have this execute all the time in my cloud code? I can't seem to find a place to enter this in the NoSQL explorer.


Best Answer

Hello David, following tutorial here. You'll see that we advise adding your indexes to Game Published System Module. On Preview, Game Published runs every time you save changes in your game, ensuring the indexes are always up to date. On Live this runs when you publish the Snapshot to the Live game. We don't expose Indexing through NoSQL explorer as we treat your indexing as game configuration and not something that should be run manually. Finally having set your own indexing on Game Published ensures that they are always present in your game config even if it has to be moved to a different cluster.

1 Comment

Answer

Hello David, following tutorial here. You'll see that we advise adding your indexes to Game Published System Module. On Preview, Game Published runs every time you save changes in your game, ensuring the indexes are always up to date. On Live this runs when you publish the Snapshot to the Live game. We don't expose Indexing through NoSQL explorer as we treat your indexing as game configuration and not something that should be run manually. Finally having set your own indexing on Game Published ensures that they are always present in your game config even if it has to be moved to a different cluster.

Login to post a comment