Skip to content

Instantly share code, notes, and snippets.

@murdockcrc
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save murdockcrc/c9d06ada4b6ecc4d1166 to your computer and use it in GitHub Desktop.
Save murdockcrc/c9d06ada4b6ecc4d1166 to your computer and use it in GitHub Desktop.
DocumentDB facade (wrapper)
//Constructor
function AzureDbHelper(databaseName, collectionName){
var _this = this;
if(!this.database || !this.collection) {
readOrCreateDatabase(databaseName, function (error, database) {
if (error) {
//throw new Error(error);
return;
}
_this.database = database;
_this._readOrCreateCollection(_this.database, collectionName, function (error, collection) {
if (error) {
//throw new Error(error);
}
_this.collection = collection;
});
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment