Skip to content

"odd number of parameters" #32

@asicerik

Description

@asicerik

Hello -
I am trying to use AddVertexByStruct with manually created properties. It works fine with single valued properties. If I try to add multiple values it fails with the "odd number of parameters" error.

Here is the code I am using to create the properties:
props := make([]model.Property, slice.Len())
for j := 0; j < slice.Len(); j++ {
props[j] = grammes.NewProperty(graphName, slice.Index(j).Interface())
}
vertex.Value.Properties[graphName] = props
Am I doing this wrong, or is there a bug?
I think this is because it creates the parameter strings using the key + values where it should put the key in every time.
The code in question is:
for key, vals := range vertex.Value.Properties {
properties = append(properties, key)
for _, val := range vals {
properties = append(properties, val.Value.Value.Value)
}
}

This will result in a string like "key", "val1", "val2", etc. instead of "key", "val1", "key", "val2" which is what AddVertex seems to expect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions