Last active
October 25, 2018 08:19
-
-
Save joselcvarela/c2dd8e16ce43eed21643dd52b52f589e 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
var ip = "http://localhost" | |
var dbName = "DB_NAME" | |
var viewType = "VIEW_TYPE" | |
var viewName = "VIEW_NAME" | |
$.getJSON(ip+":5984/"+dbName+"/_design/"+viewType+"/_view/"+viewName+"/", function(data) { | |
data.rows.forEach(function (doc) { | |
$.ajax({ | |
url: ip+":5984/"+dbName+"/" + doc.value._id + '?rev=' + doc.value._rev, | |
type: 'DELETE', | |
success: function(result) { | |
console.log("Deleted document with id " + doc.value._id); | |
} | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment