Last active
August 29, 2015 14:26
-
-
Save murdockcrc/c9d06ada4b6ecc4d1166 to your computer and use it in GitHub Desktop.
DocumentDB facade (wrapper)
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
//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