================ sh.removeTagRange() ================ .. default-domain:: mongodb Definition ---------- .. method:: sh.removeTagRange(namespace, minimum, maximum, tag) .. versionadded:: 2.8 Removes a range of shard key values to a shard tag created using the :method:`sh.removeShardTag()` method. :method:`sh.removeTagRange()` takes the following arguments: .. include:: /reference/method/sh.removeTagRange-param.rst Use :method:`sh.removeShardTag()` to ensure that unused or out of date ranges are removed and hence chunks are balanced as required. Only issue :method:`sh.removeTagRange()` when connected to a :program:`mongos` instance. Example ------- Given a shard key of ``{state: 1, zip: 1}``, the following operation removes an existing tag range covering zip codes in New York State: .. code-block:: javascript sh.removeTagRange( "exampledb.collection", { state: "NY", zip: MinKey }, { state: "NY", zip: MaxKey }, "NY" )