MongoDB Documentation, Release 3.0.4 Example Given a collection named users in the records database, sharded by the zipcode field. The following operations assign: Note: Shard ranges are always inclusive of the lower value and exclusive of the upper boundary. The mongod does not provide a helper for removing a tag range. You may delete tag assignment from a shard key range by removing the corresponding document from the tags (page 742) collection of the config database. Each document in the tags (page 742) holds the namespace of the sharded collection and a minimum shard key value. The following example removes the NYC tag assignment for the range of zip codes within Manhattan: use config db.tags.remove({ _id: { ns: "records.users", min: { zipcode: "10001" }}, tag: "NYC" }) The output from sh.status() lists tags associated with a shard, if any, for each shard. A shard’s tags exist in the shard’s document in the shards (page 742) collection of the config database. To return all shards with a specific tag, use a sequence of operations that resemble the following, which will return only those shards tagged with NYC : use config db.shards.find({ tags: "NYC" }) You can find tag ranges for all namespaces in the tags (page 742) collection of the config database. The output of sh.status() displays all tag ranges. To return all shard key ranges tagged with NYC , use the following sequence of operations: use config db.tags.find({ tags: "NYC" }) $^{19}$http://www.mongodb.com/lp/white-paper/multi-dc?jmp=docs $^{20}$https://www.mongodb.com/presentations/webinar-multi-data-center-deployment?jmp=docs • Webinar: Multi-Data Center Deployment 20 • Whitepaper: MongoDB Multi-Data Center Deployments 19 731 10.3. Sharded Cluster Tutorials Additional Resource View Existing Shard Tags Example Remove a Tag From a Shard Key Range • two ranges of zip codes in Manhattan and Brooklyn the NYC tag • one range of zip codes in San Francisco the SFO tag sh.addTagRange("records.users", { zipcode: "10001" }, { zipcode: "10281" }, "NYC") sh.addTagRange("records.users", { zipcode: "11201" }, { zipcode: "11240" }, "NYC") sh.addTagRange("records.users", { zipcode: "94102" }, { zipcode: "94135" }, "SFO")