Skip to content

Instantly share code, notes, and snippets.

@dcomartin dcomartin/sproc.js
Created Apr 7, 2017

Embed
What would you like to do?
function sp_demo(customers){
var context = getContext();
var collection = context.getCollection();
var collectionLink = collection.getSelfLink();
for (var x in customers) {
if (!customers[x].Name) throw "Invalid Customer Name";
collection.createDocument(collectionLink, customers[x]);
}
var response = context.getResponse();
response.setBody(customers.length);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.