0

I have a MongoDB collection having a Tree Structure and need to use sharding. I couldn't find anything specific to Tree Structures in the documentation on Sharding. If anybody can let me know how to approach this, that'd be great. Thank you.

  • 1
    By default, indexes in MongoDB is B-tree structure. So when you use sharding, it's actually already stores as Tree structure. – Valijon Apr 19 '20 at 13:41
  • Thank you @Valijon. Do you know how to go about setting shard keys for a tree structure? – Akalanka Weerasooriya Apr 19 '20 at 16:00
  • Can you post sample data? You don't need to save as Tree structure, you can build it querying with [$graphLookup](https://docs.mongodb.com/manual/reference/operator/aggregation/graphLookup/index.html#considerations) – Valijon Apr 19 '20 at 16:11

0 Answers0