dimanche 8 mars 2015

Mongoose Mixed Schema not working

I am trying to set mixed Schema in ExpressJs I tried to use mongoose.Schema.Types.Mixed didn´t worked and tried explicit as shown bellow but unfortunately it fails with same error:



"C:\Program Files (x86)\JetBrains\WebStorm 9.0.3\bin\runnerw.exe" "C:\Program Files (x86)\nodejs\node.exe" app.js


c:\Users\User\Desktop\nodekid\node_modules\node-restful\lib\model.js:247 app.getDetail = app.get; ^ TypeError: Cannot read property 'get' of undefined at Function.Model.register (c:\Users\User\Desktop\nodekid\node_modules\node-restful\lib\model.js:247:22) at Object. (c:\Users\User\Desktop\nodekid\routes\api.js:10:8) 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. (c:\Users\User\Desktop\nodekid\app.js:18:17) at Module._compile (module.js:456:26)


Process finished with exit code 8




/**
* Created by User on 3/8/2015.
*/
var restful = require("node-restful");

var mongoose = restful.mongoose;

var storeSchema = new mongoose.Schema({
name: String,
products: [new mongoose.Schema({
name : String,
description : String
})]

});
module.exports = restful.model("store", storeSchema);

Aucun commentaire:

Enregistrer un commentaire