Search Results for

    Show / Hide Table of Contents

    Data source management

    In Casewhere Admin, navigate to Data Sources to create, edit, and manage data sources like any product resource.

    The Data Sources list

    Data source editor

    Casewhere provides an editor to design and configure data sources.

    The General section of the data source editor

    General information

    Name: Data source name must be unique

    Primary Data Class: You must select a primary data class for the data source. From here, you can link to different related data classes to build a rich data source

    Tags: Tags are used to facilitate searching and resource management

    Design data source

    In the Design section, click on the data node data node to select what to include in the data source output. Note that a data source can have multiple data nodes; each represents a data class. The root node represents the primary data class.

    The Design section: the primary data class node and its fields

    Click on the field node to edit. You can easily see that the field icon reflects the field data type.

    • Field Name: The name of the data class attribute. You can only edit the field name for custom fields
    • Title: The title of the field shown on UI. Casewhere accepts a text resource key here
    • Data Type: The data attribute type. You can only edit for custom fields
    • Is Filterable: Determine if the data consumers can filter by this field

    The settings of a field

    You can enrich the data source by joining a data class related to the primary. To do that, select the data node, click Add and choose Add Related Data Class.

    • Related Data Class: Select the data class to join. As you can easily see, the relationships are deternmined by foreign keys.
    • Alias: Name of the field holding the information of the joined data class. The default name is the data class name.

    The Add Related Data Class dialog

    You can add a custom field by choosing Add > Add Custom Field, and define the field logic by providing a MongoDB expression in Expression. The below example shows how to add a custom field for FullName computed from the two base fields FirstName and LastName.

    A custom field with a MongoDB expression

    Advanced settings

    Scripting

    Scripting is useful when you need to calculate aggregate values for the data in a collection, e.g., monthly income, sales per employee, etc. To start building a data source using scripting, open the Script section and check Custom Script. After that, define the aggregation pipeline using MongoDB Aggregation Framework. Click here to learn more about scripting data source.

    The Script section with Custom Script checked

    REST

    It's possible for frontend components in worker sites to query the data source directly over HTTP. To enable this, open the Security section and check Access From Worker Site. You can protect the data source by adding server rules under Security Policy Rule — see access rules. Click here to learn how to use RESTful data sources in Casewhere.

    The Security section with Access From Worker Site checked

    In This Article
    Back to top Generated by DocFX