but curl for eventing is not working for me :
os : ubuntu 18.4
couchbase vsersion : 5.5.0
Eventing function code :
function OnUpdate(doc, meta) {
log(‘document’, doc);
var response = curl("h t t p : / / l o c a l h o s t : 30 0 0 / n o t if y ", { method: “POST”, data: doc });
log(‘curl’, response);
}
function OnDelete(meta) {
}
log :
2019-03-04T16:11:34.433+05:30 [INFO] “document” {“click”:“to easddi54asddt”,“with JSON”:“there are no reserved field names”,“_type”:“sms”,“task_status”:“pending”,“a”:“dzgsdsdhghx”}
2019-03-04T16:11:34.433+05:30 [INFO] OnUpdate Exception: noti.js:4
2019-03-04T16:11:34.433+05:30 [INFO] var response = curl('h t t p : / / l o c a l h o s t : 3 0 0 0 / n ot i f y ', {
I’m happy to say we’re preparing GA version of Curl which is substantially enhanced and easier to use. You can see the improved APIs and usability enhancements here:
Please let us know if you’d like a preview of the above and I’ll be happy to share an early build. Please let me know which OS you’re interested in it.
Thanks Siri, really really appreciate your replay. luckily issue is solved when i update version 6.0.0
really good work for Eventing…
now I just want to know, can i update same document or other document in same bucket via eventing function?
I want to update “task_status”:“pending” to “task_status”:“sent” when event function execute any document
That’s great Dhaval! In 6.0, as we cannot suppress recursion, we don’t allow modifying documents in the bucket that is source of mutations to a given handler. But in the upcoming 6.5 release, we detect and suppress such recursion automatically, and so you can use Eventing’s KV bucket operation to modify the documents of the source bucket (“Source Bucket Mutation”). That’s yet to be released, so for now you could work around using two buckets, or use the pre-release build I mentioned earlier for development and testing purposes.