0
이전 버전의 mongoose.js를 사용하는 앱이 있는데, 2.9.x로 업그레이드하는 중이었습니다 (3.x로 업그레이드 할 의도가 있음). 이 업데이트는 성공적입니다.) 스키마 형식이 Mixed
인 항목을 설정하려고 시도 할 때까지 (대부분) 제대로 작동하는 것으로 보입니다. 이 작업을 수행하면 TypeError: Cannot read property 'name' of undefined
이라는 오류가 발생합니다. 여기 혼합 스키마 유형 오류 설정
{type: 'string', companies: ['company1', 'company2']}
를) 나는
modal
속성을 설정하려고 시도 할 때까지
mongoose = require 'mongoose'
Schema = mongoose.Schema
Mixed = Schema.Types.Mixed
LogItemSchema = new Schema({
action: String
, user: String
, comment: String
, time: Date
, modal: Mixed
})
module.exports = LogItem = mongoose.model('LogItem', LogItemSchema)
내가가, 새로운 LogItem의 벌금을 만들 수 있습니다, 그것은 밖으로 오류가 발생하지 .
모달을 설정하지 않으면 오류가 없습니다. 왜이게 될거야?