0
votes

when using GET method with startkey and endkey, it works fine and gives a list of all "datestamp" that falls in the startkey-endkey range:

http://localhost:5984/reservations/_design/default/_view/by_datestamp?startkey=1438704000002&endkey=1438704000005

but when I use POST method with JSON Payload, it just gives all records that has the "datestamp" field regardless of value:

http://localhost:5984/reservations/_design/default/_view/by_datestamp

Payload:

{"startkey":"1438704000004","endkey":"1438704000005"}

My view looks like this:

{
  "by_id": {
   "map": "function(doc) {
              if(doc.id) {
                 emit(doc.id, doc);                
              }            
            }"
   },
   "by_datestamp": {
   "map": "function(doc) {
             if(doc.datestamp) {
              emit(doc.datestamp, doc);
            }
        }"
     }
}
1
Where is that way of using POST documented? Are you using correct Content-Type when POSTing?h4cc
I have other data to send with it that I don't want to show, yes I have the correct posting content-type.Raul Coronel

1 Answers

0
votes

According to the docs the only argument you can send in the post body is keys.