【发布时间】:2011-11-22 08:35:24
【问题描述】:
SocialProfileSchema = new mongoose.Schema
source: String
user_id: String
profile_url: String
UserProfileSchema = new mongoose.Schema
socialProfiles: [SocialProfileSchema]
这是我的代码。有效吗?
【问题讨论】:
SocialProfileSchema = new mongoose.Schema
source: String
user_id: String
profile_url: String
UserProfileSchema = new mongoose.Schema
socialProfiles: [SocialProfileSchema]
这是我的代码。有效吗?
【问题讨论】:
是的!事实证明这是有效的!
【讨论】:
该代码将在 UserProfiles 中创建一个嵌入的 SocialProfiles 文档数组 -- http://mongoosejs.com/docs/embedded-documents.html
【讨论】: