Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why "There are no properties set for this Node"? #20

Closed
breitmark opened this issue Sep 14, 2018 · 4 comments
Closed

Why "There are no properties set for this Node"? #20

breitmark opened this issue Sep 14, 2018 · 4 comments

Comments

@breitmark
Copy link

I have

    instance
        .with({
            WorkBase: require('./models/WorkBase'),
        });

    instance.extend('WorkBase', 'OrgUnit', require('./models/OrgUnit'));

with WorkBase.ts:

module.exports = {

    id: {
        type: 'uuid',
        primary: true
    },
    name: {
        type: 'string',
        indexed: true,
        required: true
    }}

and OrgUnit.ts:

module.exports = {
    // EXTENDS: WorkBase

    owns: { // orgunit belongs to this orgunit
        type: 'relationship',
        relationship: 'owns',
        direction: 'out',
        target: 'OrgUnit',
        properties: {
            since: 'number',
        },
    },
    participate: { // orgunit participates in this orgunit
        type: 'relationship',
        relationship: 'participate',
        direction: 'out',
        target: 'OrgUnit',
        properties: {
            since: 'number',
        },
    }}

Why do I get the error on:
Neode.model('OrgUnit').create({id:1, name:'xyz'}).then()

@adam-cowley
Copy link
Owner

Which version are you using?

I've noticed that you've got id set as a uuid but you've passed through a number. It shouldn't be an issue but it's worth checking.

@breitmark
Copy link
Author

I am using the NPM which is 0.1.16 . The "id issue" just happend as i reduced my code for the issue text. I will update now to the new NPM

@adam-cowley
Copy link
Owner

After a quick test, it looks like you need to use export default out of the box with typescript rather than module.exports.

@breitmark
Copy link
Author

Thank you! It works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants