Document Design and Document IDs

couchdbdatabase-designdocument-orientednosql

I was wondering about specifying id's in CouchDB. For example:

House
– Rooms
— Kitchen
— Living room
— …
– Windows
– Doors

There are some documents, like "House", where there is and will only be one document of this type. Should I specify the id "house" for this document for quick access or rather use a generated id?

Best Answer

It's best not to use the name of a "type" as an id - it is better to use generated id's and have a key called "type" in each document where you have a string value of "Home" etc