felix001
felix001

Reputation: 16691

Couch DB Design

I'm currently looking to design a new couch DB, and need some advise on the most effient method/way of laying , setting it up.

The DB will be local and will consist of a single DB, with my multi docs looking like,

{"name":"bob","age":"32":"data":"........."}
{"name":"fred","age":"33":"data":"........."}
{"name":"jane","age":"34":"data":"........."}
 .... few thousand more documents !

The thing will be the data value will consist of a few thousand lines. As there will be a few thousand documents, what will be the best way to say show me the doc that contains name "fred". Or will this type of look up no create any performance issues ?

Thanks,

Upvotes: 2

Views: 89

Answers (1)

Daniel
Daniel

Reputation: 8368

I guess name isn't unique hence not appropriate at all for _id so you can then make a view that returns name as a key. Then you can query that view for all keys matching "fred" and then lookup the documents of interest using the returned _ids, or perhaps use include_docs.

Upvotes: 2

Related Questions