-
-
Save atuttle/a57be3663d2baaed24a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ [Error: Request body must be a JSON object] | |
name: 'Error', | |
scope: 'couch', | |
status_code: 400, | |
'status-code': 400, | |
request: | |
{ method: 'POST', | |
headers: | |
{ 'content-type': 'application/json', | |
accept: 'application/json' }, | |
uri: 'https://user:pass@snitchio.cloudant.com/poc/_bulk_docs', | |
body: '[{"_id":"2e77002c-9d73-49b1-b925-c8c8b1ec2a5b","_rev":"1-e87a526f725b920c988aada7364ff408","_deleted":true}]', | |
timeout: 30000, | |
callback: [Function] }, | |
headers: | |
{ 'x-couch-request-id': '30b6e5a6', | |
date: 'Sat, 09 Mar 2013 04:44:39 GMT', | |
'content-type': 'application/json', | |
'cache-control': 'must-revalidate', | |
'status-code': 400, | |
uri: 'https://user:pass@snitchio.cloudant.com/poc/_bulk_docs' }, | |
errid: 'non_200', | |
error: 'bad_request', | |
reason: 'Request body must be a JSON object', | |
description: 'Request body must be a JSON object', | |
stacktrace: | |
[ 'Error: Request body must be a JSON object', | |
' at Request._callback (/Users/adam/DEV/nano/nano.js:318:39)', | |
' at Request.init.self.callback (/Users/adam/DEV/nano/node_modules/request/main.js:122:22)', | |
' at Request.EventEmitter.emit (events.js:99:17)', | |
' at Request.<anonymous> (/Users/adam/DEV/nano/node_modules/request/main.js:661:16)', | |
' at Request.EventEmitter.emit (events.js:126:20)', | |
' at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/Users/adam/DEV/nano/node_modules/request/main.js:623:14)', | |
' at IncomingMessage.EventEmitter.emit (events.js:126:20)', | |
' at IncomingMessage._emitEnd (http.js:366:10)', | |
' at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)' ] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var set = []; | |
_.each(exceptions.rows, function(el, ix, value){ | |
set.push({ "_id": el.id, "_rev": el.value._rev, "_deleted": true }); | |
}); | |
db.bulk(set, function(err, res){ | |
if (err){ | |
return callback(false); | |
} | |
callback(null, set.length); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment