I'm trying use function User.findAll to return all users in neo4j, but when i set opts 'include.model' with 'User' that is my model, return error ''(__sminc' + include + ':' + includeOpts.model.type + ')');'.
'Cannot read property 'type' of undefined'.
My code
var db = require('./config');
var User = require('seraph-model')(db, 'User');
User.setUniqueKey('username');
User.schema = {
userid: {
type: String,
required: true
},
username: {
type: String,
required: true
}
}
User.findAll({include: {model: 'User'}}, function(err, result){
if(err) console.log(err.neo4jError.message);
console.log(result);
})
Hi guys!
I'm trying use function User.findAll to return all users in neo4j, but when i set opts 'include.model' with 'User' that is my model, return error ''(__sminc' + include + ':' + includeOpts.model.type + ')');'.
'Cannot read property 'type' of undefined'.
My code
Can you help me?