You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: