NoSQL Explorer

Introduction

The NoSQL Explorer allows you to interact with the data stored for your game in the Mongo DB collections on the platform:

Important! If you're working on a new game that was created after the Game Data Service was launched in January 2018, you won't be able to create new Mongo Runtime collections in the Collections panel and you'll get an error if you try to do this or if you try to create a Runtime collection using Cloud Code. For details on how to work with the new Game Data Service, see Data Type Explorer.

When you open the NoSQL Explorer, there are two main things to note:

PREVIEW Stage or LIVE Stage Database?

Each game has its own PREVIEW stage Mongo database. If you've taken a game Snapshot and published the game to LIVE stage, the game will also have a LIVE stage Mongo database:

Note The Preview/Live switch will be enabled only if you have already published a game configuration Snapshot of your game to Live. The default selection is Preview stage.

What Database Collection Operation?

When you select a Database Collection, the Actions available for use with that Collection represent the different operations you can perform against the data in the selected Mongo database. See below for a detailed account of how to work with these operations.

Checking Database Statistics

If you want to check the database statistics for the current game's Mongo database, click the Database Stats information button on the Collections panel:

A Database Stats panel opens:

Click OK to close the Database Stats panel at any time:

Selecting a Mongo DB Collection

You can use the Collections panel to select the Mongo DB Collection that you want to work with - click to expand any of the headings in the listing:

Here, we've selected the System>player Collection.

Selecting Actions

When you select a Collection, the Actions available for use with that Collection are shown as a series of option buttons. When you select an Action, the panel adjusts for the entering the specific operation parameters:

For details of the parameters used for each operation, see the following section

Selecting Multiple Collections

If you want to work with more than one Collection, each selection you make adds a tab for a Collection:

Working with the Output Panel

The results for the operations you perform against a database Collection are returned into the Output panel - you can click Find or Explain to get results. For example, here is the result for Explain for the Find tab:

When the panel loads, the results hierarchy is collapsed. You can drill-down to expand the levels and read-off details:

You can edit or delete individual Documents in a Collection from the Output panel.

NOT SYSTEM COLLECTIONS! Do not attempt to edit or delete any System Collection Documents manually. Caching operations which are managed by the platform will end up with invalid data if you do this!

RUNTIME or META COLLECTIONS? You can manually edit or delete Documents from these Collections, but only update META Collections in PREVIEW. You can update RUNTIME Collections in both PREVIEW and LIVE.

Editing a Document

1. Select a Collection and submit a Find to return results into the Output panel.

2. Expand the individual Document returned for your query and that you want to edit:

Query Timeout! If you submit a query against a very large Collection, the query might timeout at 10 seconds. You will see a message but no data will be returned.

3. Click to edit the Document you've expanded. An Edit Document dialog appears.

4. Use the editor in the dialog to make your editing changes to the Document and click Save:

Deleting a Document

1. Select a Collection and submit a Find to return results into the Output panel:

2. Expand the individual Document returned for your query and that you want to delete.

3. Click to delete the Document you've expanded. A confirmation dialog appears with details of the Document you're about to delete from the Collection:

4. Click Delete again, if you want to continue and delete the Document.

Actions for Selected Collection

When you've selected the database Collection you want to work with, you can select one of the Actions available for that Collection: Find, Count, Insert, Update, Remove, Index, Aggregate, Drop, and Stats.

Creating Collections? For how to create a new Collection, see the following section.

Find

MongoDB Find Manual

Using the Find option, you can execute queries against Collections:

You Must Use Valid JSON! If you want to use Query, Sort, or Fields, you must use valid JSON syntax and only valid JSON syntax, as shown in the examples given above. Importantly, JavaScript syntax is NOT VALID.

Count

MongoDB Count Manual

Using the Count option, you can get a count of the number of documents in a Collection that match a Find query.

Insert

MongoDB Insert Manual

Using the Insert option, you can insert documents directly into a Collection.

Update

MongoDB Update Manual

Using the Update option, you can modify an existing document(s) in a Collection.

Remove

MongoDB Remove Manual

Using the Remove option, you can remove all documents matching the supplied query from a Collection.

Index

MongoDB Index Manual

Using the Index option, you can view the indexes that have been created for a Collection.

Aggregate

MongoDB Aggregate Manual

Using the Aggregate option, you can calculate aggregate values for data in the Collection.

You Must Use Valid JSON! You must use valid JSON syntax and only valid JSON syntax for the Aggregate field. Importantly, JavaScript syntax is NOT VALID.

Drop

MongoDB Drop Manual

Using the Drop option, you can permanently remove a Collection from the database.

Stats

MongoDB Stats Manual

Using the Stats option, you can obtain statistics about the selected collection.

Creating a Collection

From the Collections panel, you can create a new Collection in the database:

1. Click the add icon. The Create Collection dialog appears:

2. Select the type of Collection you want to create and enter a name for the new Collection:

3. Click to Create the new Collection.

Did this page help you? Please enter your feedback below. For questions about using this part of the platform, please contact support here