If the key is a composite such as clientId_userId, there is no way to query it individually to find the users associated with that client. You can list all keys; Write a javascript map phase to split the key based on a delimiter; Feed the results of this operation to a SetMemberFilter based on client ID; Use another map reduce operation on the account_user bucket with this SetMemberFilter
.
Your data is not modelled correctly for Riak. Had the user info just contained a secondary index for the client ID, this would have been a simple call to that bucket. I'm afraid there is no easy answer. You can still retrieve the information using the series of steps I outlined in my answer, but it would be inefficient. There is no other way.