Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9092,6 +9092,10 @@
"createMode": {
"description": "Enum to indicate the mode of resource creation.",
"$ref": "#/definitions/CreateMode"
},
"materializedViewDefinition": {
"$ref": "#/definitions/MaterializedViewDefinition",
"description": "The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container."
}
},
"required": [
Expand Down Expand Up @@ -9422,6 +9426,24 @@
"encryptionAlgorithm"
]
},
"MaterializedViewDefinition": {
"type": "object",
"description": "Materialized View definition for the container.",
"properties": {
"sourceCollectionId": {
"description": "The name of the source container on which the Materialized View will be created.",
"type": "string"
},
"definition": {
"description": "The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container.",
"type": "string"
}
},
"required": [
"sourceCollectionId",
"definition"
]
},
"SqlStoredProcedureResource": {
"type": "object",
"description": "Cosmos DB SQL storedProcedure resource object",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"parameters": {
"accountName": "ddb1",
"resourceGroupName": "rg1",
"api-version": "2022-11-15-preview",
"subscriptionId": "subid",
"databaseName": "databaseName",
"containerName": "mvContainerName",
"createUpdateSqlContainerParameters": {
"location": "West US",
"tags": {},
"properties": {
"resource": {
"id": "mvContainerName",
"partitionKey": {
"paths": [
"/pk"
],
"kind": "Hash"
},
"materializedViewDefinition": {
"sourceCollectionId": "sourceContainerName",
"definition": "select * from ROOT"
}
},
"options": {}
}
}
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/containers/mvContainerName",
"name": "mvContainerName",
"type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers",
"location": "West US",
"tags": {},
"properties": {
"resource": {
"id": "mvContainerName",
"indexingPolicy": {
"indexingMode": "consistent",
"automatic": true,
"includedPaths": [{
"path": "/*"
}
],
"excludedPaths": [{
"path": "/\"_etag\"/?"
}
]
},
"partitionKey": {
"paths": ["/pk"],
"kind": "Hash"
},
"defaultTtl": -1,
"uniqueKeyPolicy": {
"uniqueKeys": []
},
"conflictResolutionPolicy": {
"mode": "LastWriterWins",
"conflictResolutionPath": "/_ts",
"conflictResolutionProcedure": ""
},
"geospatialConfig": {
"type": "Geography"
},
"materializedViewDefinition": {
"sourceCollectionRid": "e9N-s6Ua-4Y=",
"sourceCollectionId": "sourceContainerName",
"definition": "select * from ROOT"
},
"_rid": "e9N-s+nr644=",
"_ts": 1666700363,
"_etag": "\"00004700-0000-0800-0000-6357d44b0000\""
}
}
}
},
"202": {}
}
}