I'm trying to wrap my head around how I can represent a many-to-many relationship inside of AppEngine's Datastore in the Go Programming Language. I'm more used to traditional relational databases.
I have two types of entities in my system. Let's call them A
and B
. Every A
entity is related to some number of B
entities. Similarly, every B
entity is related to some other number of A
entities. I'd like to be able to efficiently query for all B
entities given an A
entity, and for all A
entities given a B
entity.
In the Python SDK, there seems to be a way to note fields in an entity can be ReferenceProperty
s which reference some other entity. However, I can't find something similar in Go's AppEngine SDK. Go seems to just use basic struct
s to represent entities.
What's the best practice for dealing with this?