Map with related documents?
Wed, 04/04/2012 - 09:00
Is it possible to build a map routine that fundamentally does a join?
For instance, if I have 2 objects, call them User and Game. User has "user_id" and "display_name" in it. Game has a "created_by_userid" in it. Can I get a document from a view that shows a subset of the data in Game (simple to do) PLUS the display name of the user that created it, or do I have to do 2 separate gets to do this?
drakmir,
If you're using the memcached protocol along with the Couchbase Server Views system, you can use a "getMulti" request to retrieve all the user documents referenced in your View results by their ID in the second request done via memcached.
What SDK are you using? I'd be happy to give you more specifics from there.
Let me know if you have more questions about this approach,
Benjamin