Closed ghost closed 8 years ago
nested object saving is not working with neo4j 3.0.3
user model
var db = require('../config/db').db; var model = require('seraph-model'); var User = model(db, 'User'); var profile = require('./profile').Profile; var role = require('./role').Role;
User.compose(profile, 'profile', 'HAS_PROFILE'); User.compose(role, 'role', 'HAS_ROLE');
User.setUniqueKey('userId');
User.schema = { userId : {type: String, required: true}, password : {type: String, required: true}, createdOn : {type: Date, default : new Date().getTime()} };
exports.User = User;
saving user data
userModel.save(property, function(err, saved) { console.log(saved); db.relationships(saved, function(err, rels) { console.log(rels) });
// Read directly with seraph db.read(saved, function(err, userInfo) { console.log(userInfo) }) // Read with model, and you get compositions implicitly. userModel.read(saved, function(err, userInfo) { console.log(userInfo) }); });
.save is working for 2.3.2 but not working for 3.0.3 please suggest
This should work now, please try updating to 0.8.3.
nested object saving is not working with neo4j 3.0.3
user model
var db = require('../config/db').db; var model = require('seraph-model'); var User = model(db, 'User'); var profile = require('./profile').Profile; var role = require('./role').Role;
User.compose(profile, 'profile', 'HAS_PROFILE'); User.compose(role, 'role', 'HAS_ROLE');
User.setUniqueKey('userId');
User.schema = { userId : {type: String, required: true}, password : {type: String, required: true}, createdOn : {type: Date, default : new Date().getTime()} };
exports.User = User;
saving user data
userModel.save(property, function(err, saved) { console.log(saved); db.relationships(saved, function(err, rels) { console.log(rels) });
.save is working for 2.3.2 but not working for 3.0.3 please suggest