I am currently in the process on deciding which stack I'll use for a (small) social network . I would love to code it in golang on top of Google App Engine since this would result in clean, fast code with all the advantages of modern cloud services & hosting.
How would you implement one-to-many and/or many-to-one relationships in GAE with golang? According to the docs you can use your own types in datastore-structs, as long as their properties are the ones mentioned in the documentation. So for example:
type Comment struct {
Title string
Text string
User *User
}
type Photo struct {
Description string
Comments []*Comment
}
should work in my opinion, am I right? And if I am right, how can I:
a) populate this relationship in one query?
b) add comments to a photo in a convenient way? (such as MongoDBs '$push')
best, Michel