I am trying to set up a Azure DocumentDB using Javascript SDK. So far I have a master key, a endpoint url, as well as a database set up and a collection. What I cannot figure is how to substitute what I have with the values they require and I cannot find anything to refrence in the documentation or otherwise.
below is the code I am trying to fill the values in for. My thought was that collectionurl = my endpoint url, resourceToken = my key, collectionId = collection name. but then what is hostedendpoint and how should I set up the resourceToken? I know its not much to go on but if anyone has used DocumentDB I would really appreciate the help.
var host = (hostendpoint); // Add your host
var resourceToken = {};
resourceTokens[(collectionId)] = (resourceToken); // Add the collectionId and resourceToken for read/write on the collection
var collectionUrl = (collectionUrl); // Add the collection self-link
var client = DocumentDB.createClient(host, {resourceTokens: resourceTokens});
var documentDefinition = {id: "Hello world document", content: "Hello World!"};
client.createDocument(collectionUrl, documentDefinition, function(err, createdDocument) {
if (err) {
throw err;
}
console.log('result', createdDocument.content);
})