【问题标题】:How I can get a mongoose schema from a model keystone? (or how I can generate a mongoose schema from a collection)如何从模型基石中获取猫鼬模式? (或者我如何从集合中生成猫鼬模式)
【发布时间】:2017-03-04 13:55:09
【问题描述】:

我想将 keystone 连接到另一个要求 mongoose 架构的应用。

如何从模型基石中获取猫鼬模式? (或者我如何从集合中生成猫鼬模式)

【问题讨论】:

  • 您是想弄清楚如何在 NodeJS 路由中公开您的 Keystone 架构,还是尝试在另一个架构内工作并将您的 Keystone 架构有效地插入现有的 MongoDB 架构?

标签: mongodb mongoose keystonejs


【解决方案1】:

我刚刚发现您可以像这样使用 Keystone 列表的架构:

var User = new List('User')
User.schema // Use this for the mongoose model

【讨论】:

  • 不过,这并不能让您访问实际的 Keystone User 列表。它只是在它的位置实例化一个新的,这可能不是你想要的。
猜你喜欢
  • 2016-07-15
  • 1970-01-01
  • 2021-06-20
  • 1970-01-01
  • 2016-08-05
  • 1970-01-01
  • 2012-02-02
  • 2018-10-09
  • 1970-01-01
相关资源
最近更新 更多