node.js - How to use jaydata with Nodejs and krakenJS? -
from tutorial, code below: https://www.youtube.com/watch?v=5vav84na_sg&list=pl1llnoubciiduwyuq9kzngcfdcfhvp0iw&index=26
i using krakenjs, nodejs, jaydata, mongodb. when run server, , navigate localhost:8000/ , shows next error:
internal server error url / had next error typeerror: cannot phone call method 'resolvesetoperations' of undefined. i not familiar of above technology. hope can give me hand. how debug?where jaydata's documentation on mongodb provider? thanks.
controllers/index.js
'use strict'; var indexmodel = require('../models/index'); module.exports = function (router) { var model = new indexmodel(); router.get('/', function (req, res) { var $data = require('jaydata'); $data.class.define('product',$data.entity,null,{ id:{type:'id',key:true,computed:true,nullable:false}, title:{type:'string'}, date:{type:'string'}, description:{type:'string'}, price:{type:'int'}, category:{type:'string'}, teaserurl:{type:'string'} },null); $data.class.defineex('database',[$data.entitycontext,$data.servicebase],null,{ products:{type:$data.entityset,elementtype:product} }); var db = new database({name:'mongodb', databasename:'screencastecommerce', address:'localhost', port:27017}); db.products.toarray(function (products) { res.render('admin/products',{ title:'admin - products', prodcuts:products }); }); // res.render('index', model); }); };
the 2 pieces orthogonal. error you're getting isn't specific kraken @ all. looks method resolvesetoperations comes jaydata's storageproviderbase. perhaps you're writing needs inherit , not.
node.js mongodb jaydata kraken.js
No comments:
Post a Comment