incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ajay Pawaskar" <APawas...@genesisinfo.com>
Subject Getting problen in design document
Date Fri, 26 Mar 2010 10:41:39 GMT
Hi all,

            I am running in this issue regarding Boolean values.

I have a document

 

{
   "_id": "1-BRE",
   "_rev": "5-2793086578",
   "type": "XXXX",
   "Module": "YYYY",
   "isUpdated": false,
   "ResReq": true //// boolean value
}

 

And a design document

 

function(doc) {    

if(doc.IncludeinRestorePoint == true){      //// here I m trying with
Boolean value for  IncludeinRestorePoint

                        var isHtml=false;

                        if(doc.htmlDoc){

                                    isHtml=true

                        }else{

                                    isHtml=false;

                        }

                        if(!isHtml){

                                    emit(doc._id,
{"Doc":doc,"IsHtml":isHtml})

                        }else{

                                    emit(doc._id,
{"ID":doc._id,"IsHtml":isHtml})

                        }

            }

}

 

Above design document gives me proper results when I run it on futon
(browser)

 

But when I called it from my application it don't even give a hit to
design document ( I found it from erlang log)

 

But when I change my document & design document as follow it's working
fine (I can hit it from my application)

 

 

{
   "_id": "1-BRE",
   "_rev": "5-2793086578",
   "type": "XXXX",
   "Module": "YYYY",
   "isUpdated": false,
   "ResReq": "true" //// changed to the string value
}

 

And a design document

 

function(doc) {    

if(doc.IncludeinRestorePoint == "true"){ //// changed to the string
value

 

                        var isHtml=false;

                        if(doc.htmlDoc){

                                    isHtml=true;

                        }else{

                                    isHtml=false;

                        }

                        if(!isHtml){

                                    emit(doc._id,
{"Doc":doc,"IsHtml":isHtml})

                        }else{

                                    emit(doc._id,
{"ID":doc._id,"IsHtml":isHtml})

                        }

            }

}

 

Guys will u please tell me what would be the issue?

 

Note: I have other design docs where I am evaluating against the Boolean
value it's working fine

            

 

How Many Roads Must A Man Travel Down 

Before He Admits He is Lost?

 

Thanks & Regards

Ajay J. Pawaskar

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message