I am trying to get an update function to return the document as the
response. 

This responds with error [1]. 

function (doc,req) {
    
    var docId = doc ? doc._id : req.uuid;

    if (!doc) {
        doc = {}; 
        doc._id = docId;
        doc.create_date = new Date ();
        doc.title = new Date ().toDateString ();
    } 

    doc.last_change_date = new Date ();

    var resp =  {key : docId, value: doc};
    return [doc, resp];
}

[1] - {"error":"external_response_error","reason":"Invalid data from
external server: {<<\"value\">>,\n {[{<<\"_id\">> ... 
-- 
Regards,
Brian Winfrey

Reply via email to