猫鼬将版本添加到子文档

时间:2020-01-17 10:42:44

标签: mongoose mongoose-schema mongoose-plugins

我正在尝试使用Mongoose插件(如果当前更新),当某些文档未附加版本时,该插件似乎失败。例如具有模式:

Prescript==>OS-patch==>Postscript

此处嵌套的文档没有版本密钥(至少看起来像这样)。是否可以强制Mongoose向嵌套文档添加版本?我尝试将名称模式的选项参数更改为#$lbs = Get-AzLoadBalancer #foreach($lb in $lbs){ # #ForEach-Object { $lbname = ($lb).Name $bename = ($lb).BackendAddressPools.Name #$nic = $be_ids.Substring($be_ids.ToString().LastIndexOf('/', '+8')) } foreach($be in $bename){ $beconf = Get-AzLoadBalancerBackendAddressPoolConfig -Name $be -LoadBalancer $lb $be_ids = ($beconf).BackendAddressPools.BackendIpConfigurations.Id $nic = $be_ids.substring($be_ids.ToString().LastIndexOf('/', 8)+1) #$nic = $be_ids.Substring($be_ids.ToString().LastIndexOf('/', 8)+1) #$nic = $be_ids.ToString.Split('/')[+8] } Write-Output $be_ids $nic $beconf $lbname, $bename, | Sort-Object $lbname | FT$lbs = Get-AzLoadBalancer foreach($lb in $lbs){ #ForEach-Object { $lbname = ($lb).Name $bename = ($lb).BackendAddressPools.Name #$nic = $be_ids.Substring($be_ids.ToString().LastIndexOf('/', '+8')) } foreach($be in $bename){ # $beconf = Get-AzLoadBalancerBackendAddressPoolConfig -Name $be -LoadBalancer $lb # $be_ids = ($beconf).BackendAddressPools.BackendIpConfigurations.Id # $nic = $be_ids.substring($be_ids.ToString().LastIndexOf('/', 8)+1) # #$nic = $be_ids.Substring($be_ids.ToString().LastIndexOf('/', 8)+1) # #$nic = $be_ids.ToString.Split('/')[+8] # #} #Write-Output $be_ids $nic $beconf $lbname, $bename, | Sort-Object $lbname | FT ,但这不起作用。

0 个答案:

没有答案