couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Prentice <steven.prentice...@gmail.com>
Subject why wont my list function work!?!?
Date Fri, 16 Jul 2010 05:09:17 GMT
i have a view:

function(doc) {if (doc.docType == 'audit') {
emit([doc.auditRecord.resourceType, doc.auditRecord.resourceId,
doc.auditRecord.subResourceType, doc.auditRecord.subResource],
[doc.auditRecord.auditStamp.createDateTime,
doc.auditRecord.auditStamp.createdByAccessingSystem,
doc.auditRecord.auditStamp.createdByAccessingUser, doc._id]);}}

and a list function:

{
   "criteria_filter_sp": "function(head, req){var fromdate =
\"2010-03-02T07:29:30\";var row;while(row = getRow()){if (fromdate &&
row.value[0] <= fromdate){send(row.value[4]);}}}"
}

the fromDate variable will eventually be a parameter but I have hardocoded
it for simplicity whilst I learn...

when i  curl X GET
http://mycouchserver.net:5984/smpaud/_design/dates/_list/criteria_filter_sp/audit_resource_subresource_with_criteria

I get {"code":500,"error":"render_error","reason":"function raised error:
TypeError: chunk is undefined"}

...how can it be undefined if I have literally hardcoded the date??

S

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