On this page本页内容
sh.removeTagRange(namespace, minimum, maximum, tag)
Changed in version 3.4.在版本3.4中更改。
sh.removeRangeFromZone()
in MongoDB 3.4. sh.removeRangeFromZone()
。Removes a range of shard key values to a shard tag created using the 将一系列分片键值移除到使用sh.addShardTag()
method. sh.addShardTag()
方法创建的分片标记。sh.removeTagRange()
takes the following arguments:采用以下参数:
namespace | string | |
minimum | document | <fieldname>:<value> . <fieldname> :<value> 的形式指定最小值。 |
maximum | document | <fieldname>:<value> . <fieldname>:<value> 的形式指定最大值。 |
tag | string | minimum and maximum arguments to.minimum 和maximum 参数指定的范围的标记的名称。 |
Use 使用sh.removeShardTag()
to ensure that unused or out of date ranges are removed and hence chunks are balanced as required.sh.removeShardTag()
确保删除未使用或过期的范围,从而根据需要平衡块。
Only issue 仅在连接到sh.removeTagRange()
when connected to a mongos
instance.mongos
实例时发出sh.removeTagRange()
。
Given a shard key of 给定{state: 1, zip: 1}
, the following operation removes an existing tag range covering zip codes in New York State:{state: 1, zip: 1}
的分片键,以下操作将删除覆盖纽约州邮政编码的现有标记范围:
sh.removeTagRange( "exampledb.collection", { state: "NY", zip: MinKey }, { state: "NY", zip: MaxKey }, "NY" )