为什么同样的代码我的居然在updateAt:那边报错了
这是错误代码
root@lin-VirtualBox:/home/lin/nodejs-move# nodejs app.js
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
/home/lin/nodejs-move/schemas/movie.js:15
updateAt:{
^^^^^^^^
SyntaxError: Unexpected identifier
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/lin/nodejs-move/models/movie.js:2:18)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/lin/nodejs-move/app.js:6:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
这是movie.js的代码
var mongoose =require ('mongoose')
var MovieSchema = new mongoose.Schema({
docter: String,
title: String,
flash: String,
poster: String,
time: Number,
pv: {
type: Number,
default: 0
},
category: {
type: ObjectId,
ref: 'Category'
},
meta:{
createAt:{
type: Date,
default: Date.now()
}
updateAt:{
type: Date,
default: Date.now()
}
}
})
MovieSchema.pre('save',function(next){
if(this.isnow){
this.mete.createAt = this.meta.updateAt = Date.now();
}
else{
this.meta.updateAt = Date.now()
}
next()
})
MovieSchema.statics = {
fetch: function(cb){
return this
.find({})
.sort('meta.updateAt')
exec(cb)
}
fetchById: function(id,cb){
return this
.findOne({_id: id})
exec(cb)
}
}
module.exports = MovieSchema
实在没找出哪里错了...求助