-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Feature Request:
Add support for this kind of properties definition:
type Sub struct {
A int
B string
C []SubSub
}
type SubSub struct {
D int
}
type VertexA struct {
gogm.BaseNode
// provides required node fields
TestField string `gogm:"name=test_field"`
TestStruct Sub `gogm:"name=test_struct;properties"`
MapProperty map[string]string `gogm:"name=map_property;properties"`
SliceProperty []string `gogm:"name=slice_property;properties"`
SingleA *VertexB `gogm:"direction=incoming;relationship=test_rel"`
ManyA []*VertexB `gogm:"direction=incoming;relationship=testm2o"`
MultiA []*VertexB `gogm:"direction=incoming;relationship=multib"`
SingleSpecA *EdgeC `gogm:"direction=outgoing;relationship=special_single"`
MultiSpecA []*EdgeC `gogm:"direction=outgoing;relationship=special_multi"`
}It should be useful to store custom defined structs inside the node properties; as a side note a possible way to achieve this could be to flatten the struct into something like TestStruct_A, TestStruct_B, TestStruct_C_D_0.
Context
This feature could be used to directly upload complex struct into the node (i.e. coming from a JSON response/data).
Alternatives
I don't it is possible without manually rewriting the node structure with the required fields since the library only support primitive types.
Would you be interested in implementing this feature?
Yes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request