【问题标题】:How can I create a duplicate collection (tree structure) using Mongoose in Node.js?如何在 Node.js 中使用 Mongoose 创建重复集合(树结构)?
【发布时间】:2018-01-17 21:50:58
【问题描述】:

我的List(架构)层次结构如下:

List -> Items -> (attachments, comments, labels)

我想为现有列表创建另一个重复列表(集合)。这意味着,应该创建(复制)所有分层引用的元素。这里(attachments, comments, labels)Item 引用,ItemList 引用。我该怎么做?

【问题讨论】:

    标签: node.js mongodb


    【解决方案1】:

    这就是所谓的“深拷贝”。我不确定猫鼬与它有什么关系。有关 JavaScript 的一般情况请参见此问题:What is the most efficient way to deep clone an object in JavaScript?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多