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

Setting an empty list remove the attributs #2

Open
Chique80 opened this issue Nov 9, 2021 · 2 comments
Open

Setting an empty list remove the attributs #2

Chique80 opened this issue Nov 9, 2021 · 2 comments

Comments

@Chique80
Copy link

Chique80 commented Nov 9, 2021

When you use the NMF API to set an attribut that has a cardinality greater than 1 (a list), if you give an empty list, the attribut is instead remove from the node.

@vnikitch
Copy link
Contributor

vnikitch commented Nov 9, 2021

On :neo4j-io module, this feature works as expected, even with empty lists. Could you please provide a code example as well as your model?

@ghost
Copy link

ghost commented Dec 6, 2021

I think the issue is with the generated code. For exemple, this is the generated setter for an attribute that is a list of strings.

overrive fun setKeywords(v: List<String>?) {
    when {
        v == null || v.isEmpty() -> removeProperty("keywords")
        v.size in 0..3 -> putProperty("keywords", v)
        else -> throw Exception("bound limits: list size must be in 0..3")
    }
}

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