see on GitHub

Bundle: Scripted Index Results

When creating a database, if you want to use the scripted index results bundle you need to select it in the database creation window:
Tasks Fig 1

After pressing "Next" your database will be created so you will be able to configure the scripted index results. To do so, you need to enter database settings using the top navigation panel. Tasks Fig 2

On the left you will notice a 'Scripted Index' tab where you be able to configure scripts for each desired index. Tasks Fig 3

Example

Information

Below walktrough is a Studio equivalent of the example described in details here

To attach our Orders/ByCompany index results within company itself we must add two scripts:

  1. IndexScript that will be applied to reduce result.
  2. DeleteScript that will be applied when index entry will be deleted.

Tasks Fig 4

As a result of our script all our companies will have additional property Orders with Total and Count attached.

Tasks Fig 5

Information

You can read more about the Scripted Index Results Bundle in here.