15

以下のスキーマは正しく定義されていますか、または または でwritingある必要があります writing: [Schema.Types.Mixed] writing: [{}]?

つまり、辞書の配列 [{},{},{}] がある場合、別のスキーマを作成して埋め込まない限り、内部構造を事前に定義することはできません。それはドキュメントの正しい解釈ですか?

http://mongoosejs.com/docs/schematypes.html

var blogSchema = new mongoose.Schema({
  title:  String,
  writing: [{
        post: String,
        two: Number,
        three : Number,
        four  : String,
        five : [{  a: String,
                    b : String,
                    c  : String,
                    d: String,
                    e: { type: Date, default: Date.now }, 
                }]
  }],
});

ありがとう。

4

1 に答える 1