I have two entities:
- Company [companyId (PK)] and
- Employee [employeeId (PK), companyId (PK, FK)].
Is there anyway I can organize my documents in CouchDB so that I can query an employee using the following format ($CouchDB is the URL to my CouchDB instance) ?
$CouchDB/company/{companyId}/employee/{employeeId}
I know that we can mix both Company and Employee documents in one database and use meta field (e.g: "_type") and map/reduce to query the document we want. There is nothing wrong with "map/reduce" approach, just want to double check so that I don't miss anything.
Many thanks,