![](/img/trans.png)
[英]How to find a subdocument of a collection and update it with Mongoose/MongoDB?
[英]MongoDB find and insert in a tree of subdocument (mongoose)
大家好我正在為我的應用程序創建類別樹 。 可以創建的子類別的深度no limit (infinite)
。
有點像這樣:
我的CategorySchema看起來像這樣
schema: {
_id : String,
name: String,
children: [] // will contain subcats in form of {_id:String, name: String, children: []}
}
我的問題
我想要一個動態解決方案/ mongodb-query / mongoose-query 創建類別樹。 我是mongodb的新手,我無法在網絡上找到相關的問題解決方案,因此獲得了幫助。
我已經花費了很多時間嘗試。 請為我的問題提供任何(但應該是有效的)解決方案,以幫助我。
提前致謝
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.