Skip to content
Justice Tech School

Sharding Intro

Split data across servers by a shard key.

Example
sh.enableSharding("shop")
sh.shardCollection("shop.orders", { customerId: "hashed" })

Exercise

Shard key.

sh.shardCollection(ns, { k: "" })

Quiz Test

What is a shard key?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.