In relational world we have Foreign Keys to reference other entities. But how do document-oriented databases like MongoDb, CouchDb, RavenDb implement references among entities?

Update. StackExchange related example. We have Question entity and its tags. Each tag, is a separate entity so it has its properties (for example, description). How can I reference tags for some Question?

When you load a Post object you can either pull your tags documents as well, or you can pull them from cache. Often you use a ODM (instead of ORM) and it can often handle these references for you. For example, in Mongoid for Rails, you would just say :has_many :tags and it would figure out the rest for you. When you call post.tags it would just return an array of the tags associated with post.

If you want join abilities, you have to implement them in your client code. Some of these APIs do it a little easier by defining a 'Key' type that makes it easy to store and use references, but you have to do a second fetch to get the referenced entity.