incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <d...@muse.net.nz>
Subject Re: Need help in couchDB views
Date Fri, 15 Jul 2011 14:06:34 GMT
On 15 July 2011 23:02, Srikanth <srikanth_kollipara@dell.com> wrote:
> Dave Cottlehuber <dave@...> writes:
>
>>
>> On 15 July 2011 18:01, Srikanth <srikanth_kollipara@...> wrote:
>> >
>> >> On 14 July 2011 20:03, Srikanth <srikanth_kollipara@...> wrote:
>> >> > David Caylor <dcaylor@...> writes:
>> >> >> The error is indicating that your view isn't named title_3.  Double
> check
>> >> >> that you're using the right view name.
>>
>> > Link to this snippet:   http://friendpaste.com/1e1K2vQyAKa2fUBrLMWL3d
>> > Embed:
>>
>> Hey Srikanth,
>>
>> This code isn't from your original ddoc, contains irrelevant code, and
>> no view called title_3 anyway. If you're expecting the community to
>> help you please put more effort into enabling us to do so.
>>
>> Cheers
>> Dave
>>
>>sorry Dave,
> Actually i tried so many ways to figure out the error, so by mistake it
> happened.
>
> I pasted the code now.
>
> http://friendpaste.com/1e1K2vQyAKa2fUBrLMWL3d
>
>
> Srikanth

Hi Srikanth,

It looks like you are getting confused in how the various
views/shows/filters/.... all get bundled up into a design doc. Best to
read the definitive guide first few chapters first.

Then I suggest you sign up for a hosted couchdb at
http://iriscouch.com/ its free and we'll be able to see directly
what's getting you stuck.

Put a few docs in there, and then try to create a ddocs & view by
creating views in futon directly
http://blog.vicmetcalfe.com/2011/04/11/creating-views-in-couchdb-futon/

And here's an example ddoc - note the "views" is where you see your functions -

{
   "_id": "_design/ddoc",
   "_rev": "1-21543a52cccf1ec7a1e23ab5fcfe444a",
   "views": {
       "animals": {
           "map": "function(doc) {\n  if (doc.animal && doc.attribute)
{\n    emit(doc.animal, doc.attribute);\n  }\n};"
       }
   }
}

you can take a further look here
http://muse.iriscouch.com/_utils/database.html?srik/_all_docs

A+
Dave

Mime
View raw message