code: def user_organisations_resource(doc):
      
      if doc.get('type') == 'user':
          for org_id, resource in doc.get('organisations', {}).items():
              resource['id'] = org_id
              resource['user_id'] = doc['_id']
              yield [doc['_id'], org_id], resource
docs: Get user.organisations subresouces