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.
Asked
Active
Viewed 67 times
0
-
1By 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