BizTalk Adapter for Cosmos DB

Build 21.0.7930

Custom Schema Example

This section contains a complete schema. The info section enables a relational view of a Cosmos DB object. For more details, see Custom Schema Definitions. The table below allows the SELECT, INSERT, UPDATE, and DELETE commands as implemented in the GET, POST, MERGE, and DELETE sections of the schema below.

Use the collection attribute to specify the name of the collection you want to parse. You can use the collection attribute to define multiple schemas for the same collection.

If collection is not specified, the filename determines the collection that is parsed.

Copy the rows@next input as-is into your schema. The operations, such as cosmosdbadoSysData, are internal implementations and can also be copied as is.

Set the Location property to the file directory that will contain the schema file.

<rsb:script xmlns:rsb="http://www.rssbus.com/ns/rsbscript/2">  

  <rsb:info title="StaticRestaurants" description="Custom Schema for the restaurants data set.">  
    <!-- Column definitions -->
    <attr  name="borough"   xs:type="string" other:bsonpath="$.borough"              />
    <attr  name="cuisine"   xs:type="string" other:bsonpath="$.cuisine"              />
    <attr  name="building"  xs:type="string" other:bsonpath="$.address.building"     />
    <attr  name="street"    xs:type="string" other:bsonpath="$.address.street"       />
    <attr  name="latitude"  xs:type="double" other:bsonpath="$.address.coord.0"      />
    <attr  name="longitude" xs:type="double" other:bsonpath="$.address.coord.1"      />
    <input name="rows@next" desc="Internal attribute used for paging through data."  />
  </rsb:info>  

  <rsb:set attr="collection" value="restaurants"/>

  <rsb:script method="GET">
    <rsb:call op="cosmosdbadoSysData">
      <rsb:push />
    </rsb:call>
  </rsb:script>

  <rsb:script method="POST">
    <rsb:call op="cosmosdbadoSysData">
      <rsb:push />
    </rsb:call>
  </rsb:script>

  <rsb:script method="MERGE">
    <rsb:call op="cosmosdbadoSysData">
      <rsb:push />
    </rsb:call>
  </rsb:script>

  <rsb:script method="DELETE">
    <rsb:call op="cosmosdbadoSysData">
      <rsb:push />
    </rsb:call>
  </rsb:script>

</rsb:script>

Copyright (c) 2021 CData Software, Inc. - All rights reserved.
Build 21.0.7930