Re: couchdb data structure

2013-11-25 Thread Jens Alfke
On Nov 23, 2013, at 12:17 AM, John Norris wrote: > Do you mean using the keys parameter or the key parameter? As the key > parameter would consist of a single value eg "fred" so it would find all > of the users with a first name of "fred" but not just the single > document of "fred smith". I

Re[2]: couchdb data structure

2013-11-23 Thread John Norris
Hi Jens, thank you for your answers and your patience. You said "Sure. In your example, the map function just has to do emit(doc.fname, null); emit(doc.lname, null); So now both the first and last names are in the index, so view queries will find both first and last names matching your key."

Re: couchdb data structure

2013-11-22 Thread Tim Black
John, On 11/22/2013 10:58 AM, Jens Alfke wrote: > On Nov 22, 2013, at 6:18 AM, John Norris wrote: > >> To continue on this path, so if I have separate document types, where >> docTypeA has a reference to docTypeB, can I have a view that returns a >> docTypeA based on a value within docTypeB obj

Re: couchdb data structure

2013-11-22 Thread Jens Alfke
On Nov 22, 2013, at 6:38 AM, John Norris wrote: > And as an extra, is there a "key_contains" url parameter (I know there is not > in the documentation) way of returning data. So whereas key is exactly equal, > is there a way of finding keys that contain this value? I don’t think this exists.

Re: couchdb data structure

2013-11-22 Thread Jens Alfke
On Nov 22, 2013, at 6:18 AM, John Norris wrote: > To continue on this path, so if I have separate document types, where > docTypeA has a reference to docTypeB, can I have a view that returns a > docTypeA based on a value within docTypeB object? I think you can do this using the linked-documen

Re[2]: couchdb data structure

2013-11-22 Thread John Norris
And as an extra, is there a "key_contains" url parameter (I know there is not in the documentation) way of returning data. So whereas key is exactly equal, is there a way of finding keys that contain this value?

Re: couchdb data structure

2013-11-22 Thread Kevin Coombes
On 11/22/2013 9:18 AM, John Norris wrote: Hi Jens, thanks for this - makes sense. To continue on this path, so if I have separate document types, where docTypeA has a reference to docTypeB, can I have a view that returns a docTypeA based on a value within docTypeB object? My feeling from the

Re[2]: couchdb data structure

2013-11-22 Thread John Norris
Hi Jens, thanks for this - makes sense. To continue on this path, so if I have separate document types, where docTypeA has a reference to docTypeB, can I have a view that returns a docTypeA based on a value within docTypeB object? My feeling from the docs I have seen is "no". Also, my view retu

Re: couchdb data structure

2013-11-21 Thread Tim Black
I should note that instead of using the common convention Jens mentioned of a document attribute named "type," my code below uses a document attribute named "collection" since that is what backbone-relational requires. So to follow the convention of an attribute named "type" you'll have to delete

Re: couchdb data structure

2013-11-21 Thread Stanley Iriele
I think the use of the word collection is misleading...even though they are synonymous..type is far clearer... But that's all just my preference On Nov 21, 2013 12:03 PM, "Tim Black" wrote: > I should note that instead of using the common convention Jens mentioned > of a document attribute named

Re: couchdb data structure

2013-11-21 Thread Tim Black
Hi Alexander, On 11/21/2013 02:55 AM, Alexander Shorin wrote: > https://speakerdeck.com/wohali/10-common-misconceptions-about-apache-couchdb?slide=4 > (; > > I just agree with her. It doesn't simple to import sql data to nosql. > especially document-oriented, storage. Different conceptions and > r

Re: couchdb data structure

2013-11-21 Thread Alexander Shorin
Hi Tim, https://speakerdeck.com/wohali/10-common-misconceptions-about-apache-couchdb?slide=4 (; I just agree with her. It doesn't simple to import sql data to nosql. especially document-oriented, storage. Different conceptions and requirements to data applied there. -- ,,,^..^,,, On Wed, Nov 20

Re: couchdb data structure

2013-11-20 Thread Tim Black
John, On 11/19/2013 04:28 AM, John Norris wrote: > I am trying to retrofit an existing web app using SQL to couchdb with > ektorp. I have setup couchdb and run through some tutorials (ektorp, > seven databases in seven weeks, definitive guide). > If I have several objects (represented as pojos) th

Re: couchdb data structure

2013-11-20 Thread Tim Black
John, On 11/19/2013 04:28 AM, John Norris wrote: > I am trying to retrofit an existing web app using SQL to couchdb with > ektorp. I have setup couchdb and run through some tutorials (ektorp, > seven databases in seven weeks, definitive guide). > If I have several objects (represented as pojos) th

Re: couchdb data structure

2013-11-20 Thread Jens Alfke
On Nov 19, 2013, at 2:28 AM, John Norris mailto:j...@norricorp.f9.co.uk>> wrote: But in couchdb, a database is a number of documents? And those documents can represent several object types? So do I need each document to have a field representing what type it is? (eg a field that is unique to tha

couchdb data structure

2013-11-20 Thread John Norris
Hi, I am trying to retrofit an existing web app using SQL to couchdb with ektorp. I have setup couchdb and run through some tutorials (ektorp, seven databases in seven weeks, definitive guide). If I have several objects (represented as pojos) then in SQL this would probably equate to several ta