How exactly do I query then? If I'm using java to query the server, and I ask a user to enter a parameter, how do I create a view to return all the documents with that parameter? I figured I'd create a "mapFunction" in Java, and then create / overwrite a view to return. I can't seem to get this to work though.
On Thursday, 2 January 2014 16:11:13 UTC+2, Andrew Donoho wrote: > > > On Jan 2, 2014, at 06:21 , Gopinath Navaneethan <[email protected] > <javascript:>> wrote: > > I am having a bucket with different Tenant Id. Now I need to > get the data using view depends on the tenant. It has to give me the > particular details of the tenant. Is this possible to create a dynamic view. > > If i try to get the details of document which belongs to tenant id =1. > Then i have to get all the Documents in the Bucket and i have to find > tenant having the id as 1. > Instead of this I want to create a view dynamic if I give id as 1 it could > give data which having the tenant 1 or if I give id as 2 it could give data > which having the tenant 2 is this is possible. > > > > > Gopi, > > > > A perhaps better question is: what are you really trying to do? > > I ask because it appears you are thinking of Couchbase views like they are > SQL indices (with which they share some behavior). Thinking this way both > underutilizes the view's capabilities and will keep you from learning how > to model your data as appropriate for a document database. A document > database with nested documents is not a relational database; one models > one's data differently. > > Why do you want a dynamic view? Dynamism always has a cost that exceeds > the cost of static, compiled/indexed, routine behavior. Why do you want to > pay that cost? > > The short answer is that it isn't practically possible to create a dynamic > view. The long answer is you can create such a view yourself by reading > every document. You typically don't want to do this. In my case, my test > database has almost 100M documents and exceeds 90GB in size. Just reading > every bit of it at wireline speeds takes over 30 minutes (datapoint taken > from the time it takes CB to warm up on this DB from a cold start). IOW, I > could never afford to pay the dynamic cost. If your database is of any > size, I doubt you can either. > > > > Anon, > Andrew > ____________________________________ > Andrew W. Donoho > Donoho Design Group, L.L.C. > [email protected] <javascript:>, +1 (512) 666-7596, twitter.com/adonoho > > Download Retweever here: <http://Retweever.com> > > No risk, no art. > No art, no reward. > -- Seth Godin > > > > -- You received this message because you are subscribed to the Google Groups "Couchbase" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
