-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
Description
I've been looking into this particular structure and having issues when the hierarchy is created:
Contact
module.exports = {
attributes: {
emailAddress:
{
type: 'string',
primaryKey: true
},
phoneNumber:
{
type: 'string'
},
faxNumber:
{
type: 'string'
}
}
};
Person:
module.exports = {
attributes: {
firstName:
{
type: 'string',
required: true
},
middleName:
{
type: 'string'
},
lastName:
{
type: 'string',
required: true
},
birthdate:
{
type: 'date'
},
gender:
{
type: 'string',
enum: ['M', 'F']
},
contactPoint:
{
model: 'contactpoint'
},
}
};
Now when I create a Person and look in OrientDB I'm seeing that the contactPoint is being created as type string.
In fact when I created a Person and associated a ContactPoint with it:
ContactPoint.create( { emailAddress: _emailAddress, phoneNumber: _phoneNumber, faxNumber: _faxNumber })
.exec( function contactPointCreated( cErr, createdContactPoint )
{
if ( !cErr )
{
console.log( "Contact", createdContactPoint );
createdPerson.contactPoint = createdContactPoint.id;
createdPerson.save();
}
else {
console.log("Unable to create contact point", cErr );
}
});
I can go into the database and see that the type of contactPoint for the person is a string. Its holding the @Rid, but when I perform a populate on that value I don't get anything for the populated contactPoint attribute.
This is with [email protected], [email protected], and OrientDB 2.1.2.