hashicorp/go-memdb

How can I store nested Data?

Hrishi25 opened this issue · 1 comments

id: 1
company: xyz
employes:

I have above structure of incoming data. I have 2 struts to store company info and employee info. So basically I have belo field in strut company

type Company strut {
Id string
Employees []Employee
}

For above structure I wonder how do I insert employee information

Inserting objects with nested data is exactly the same as any other objects.
The main question should probably be - how to create indexes for such structs, right?
If so, you can refer to issue #97 (on using nested fields for indexes) which answers this question, including a very good example.