Skip to content

Latest commit

 

History

History
167 lines (127 loc) · 3.96 KB

Get-AzCosmosDBMongoDBCollection.md

File metadata and controls

167 lines (127 loc) · 3.96 KB
external help file Module Name online version schema
Microsoft.Azure.PowerShell.Cmdlets.CosmosDB.dll-Help.xml
Az.CosmosDB
2.0.0

Get-AzCosmosDBMongoDBCollection

SYNOPSIS

Gets the CosmosDB MongoDB Collection.

SYNTAX

ByNameParameterSet (Default)

Get-AzCosmosDBMongoDBCollection -ResourceGroupName <String> [-Name <String>]
 [-DefaultProfile <IAzureContextContainer>] -AccountName <String> -DatabaseName <String> [<CommonParameters>]

ByParentObjectParameterSet

Get-AzCosmosDBMongoDBCollection [-Name <String>] -ParentObject <PSMongoDBDatabaseGetResults>
 [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]

DESCRIPTION

The Get-AzCosmosDBMongoDBCollection cmdlet gets the CosmosDB MongoDB Collection.

EXAMPLES

Example 1

Get-AzCosmosDBMongoDBCollection -ResourceGroupName rgName -AccountName accountName -DatabaseName dbName -Name collectionName
Name     : collectionName
Id       : /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rgName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/dbName/collections/collectionName
Location :
Tags     :
Resource : Microsoft.Azure.Commands.CosmosDB.Models.PSMongoDBCollectionGetPropertiesResource

Resource Object contains AnalyticalStorageTtl, Id, Indexes, ShardKey, _etag, _rid, _ts properties.

Example 2

(Get-AzCosmosDBMongoDBCollection -ResourceGroupName rgName -AccountName accountName -DatabaseName dbName -Name collectionName).Resource.ShardKey
Key           Value
----          -----
<ShardKey>    <Value>

This example gets the ShardKey of the retrieved collection

PARAMETERS

-AccountName

Name of the Cosmos DB database account.

Type: System.String
Parameter Sets: ByNameParameterSet
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DatabaseName

Database name.

Type: System.String
Parameter Sets: ByNameParameterSet
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Parameter Sets: (All)
Aliases: AzContext, AzureRmContext, AzureCredential

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Name

Collection name.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ParentObject

Mongo Database object.

Type: Microsoft.Azure.Commands.CosmosDB.Models.PSMongoDBDatabaseGetResults
Parameter Sets: ByParentObjectParameterSet
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ResourceGroupName

Name of resource group.

Type: System.String
Parameter Sets: ByNameParameterSet
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Microsoft.Azure.Commands.CosmosDB.Models.PSMongoDBDatabaseGetResults

OUTPUTS

Microsoft.Azure.Commands.CosmosDB.Models.PSMongoDBCollectionGetResults

Microsoft.Azure.Commands.CosmosDB.Models.PSThroughputSettingsGetResults

NOTES

RELATED LINKS