Editar

Partilhar via


New-AzDataMigrationMongoDbCollectionSetting

Creates collection setting for migration according for the mongoDb migration

Syntax

New-AzDataMigrationMongoDbCollectionSetting
   [-TargetRequestUnit <Int32>]
   [-CanDelete]
   [-UniqueShard]
   [-ShardKey <String>]
   [-DefaultProfile <IAzureContextContainer>]
   -Name <String>
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzDataMigrationMongoDbCollectionSetting cmdlet creates the migration setting object that specifies the throughput and delete behavior. The output the cmdlet is key value pair with name of the collection, and value of the setting. The output is used in assembling the database level settings for migration.

Examples

Example 1

$x = New-AzDataMigrationMongoDbCollectionSetting -Name myCollection -TargetRequestUnit 1000 -CanDelete -ShardKey "_id:-1,age:1,name"
$x

Name         Setting
----         -------
myCollection Microsoft.Azure.Management.DataMigration.Models.MongoDbCollectionSettings

$x.Setting

CanDelete ShardKey                                                               TargetRUs
--------- --------                                                               ---------
     True Microsoft.Azure.Management.DataMigration.Models.MongoDbShardKeySetting      1000

Parameters

-CanDelete

Whether the target data is supposed to be deleted, if the switch is set, it will be cleaned up at migration

Type:SwitchParameter
Aliases:Clean
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Name of the collection

Type:String
Aliases:CollectionName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ShardKey

The comma separated list of the shard keys. For mongoDb target, you can specify shard key order of "ShardKeyName:Order", where order is 1, -1 or empty for hashed, for example "_id,email:-1".

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

-TargetRequestUnit

The dedicated collection request unit value. If not set, that collection uses shared database RU.

Type:Nullable<T>[Int32]
Aliases:RU
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UniqueShard

Whether to create a unique key for the shard key

Type:SwitchParameter
Aliases:Unique
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

Microsoft.Azure.Commands.DataMigration.Models.MongoDbCollectionSetting>