documentdb
Advanced tools
Comparing version 0.9.1 to 0.9.2
{ | ||
"name": "documentdb", | ||
"description": "Nodejs client for documentdb", | ||
"description": "Node.js client for documentdb", | ||
"keywords": [ | ||
@@ -12,11 +12,8 @@ "documentdb", | ||
], | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"author": "Microsoft Corporation", | ||
"main": "./documentclientwrapper.js", | ||
"main": "./index.js", | ||
"engine": { | ||
"node": ">=0.8" | ||
}, | ||
"dependencies": { | ||
"q": "*" | ||
}, | ||
"devDependencies": { | ||
@@ -23,0 +20,0 @@ "mocha": "*", |
@@ -12,15 +12,7 @@ <html> | ||
</p> | ||
<p> | ||
The Nodejs sdk has two API models: <br> | ||
Callback model: where all calls use callbacks for responses and this is exposed in DocumentClient. | ||
Promises model: where all calls use Q promises for responses ( this one is built on top of the callback model and this is exposed in DocumentClientWrapper. | ||
<p> | ||
The Nodejs sdk uses callbacks model for responses and this is exposed in DocumentClient <br> | ||
</p> | ||
<h4>Installing the library from nodejsclient folder</h4> | ||
<p><pre>> npm install nodejsclient</pre></p> | ||
<h4>Installing the library using npm</h4> | ||
<p><pre>> npm install documentdb</pre></p> | ||
<h4>Hello world example code using callbacks</h4> | ||
@@ -52,2 +44,3 @@ <p><pre style="background-color:#eee"> | ||
console.log('Created Document with content: ', document.content); | ||
cleanup(client, database); | ||
}); | ||
@@ -64,55 +57,14 @@ }); | ||
<h4>Hello world example code using Q promises</h4> | ||
<p><pre style="background-color:#eee"> | ||
var DocumentClient = require('documentdb').DocumentClientWrapper; | ||
##Community | ||
- [DoQmentDB](https://github.com/a8m/doqmentdb) - A Promise-based DocumentDB client for MongoDB users | ||
var host = [hostendpoint]; // Add your endpoint | ||
var masterKey = [database account masterkey]; // Add the massterkey of the endpoint | ||
var client = new DocumentClient(host, {masterKey: masterKey}); | ||
var databaseDefinition = { id: "sample database" } | ||
var collectionDefinition = { id: "sample collection" }; | ||
var documentDefinition = { id: "hello world doc", content: "Hello World!" }; | ||
var database, collection, document; | ||
client.createDatabaseAsync(databaseDefinition) | ||
.then(function(databaseResponse) { | ||
database = databaseResponse.resource; | ||
return client.createCollectionAsync(database._self, collectionDefinition); | ||
}) | ||
.then(function(collectionResponse) { | ||
collection = collectionResponse.resource; | ||
return client.createDocumentAsync(collection._self, documentDefinition); | ||
}) | ||
.then(function(documentResponse) { | ||
var document = documentResponse.resource; | ||
console.log('Created Document with content: ', document.content); | ||
cleanup(client, database); | ||
}) | ||
.fail(function(error) { | ||
console.log("An error occured", error); | ||
}); | ||
function cleanup(client, database) { | ||
client.deleteDatabaseAsync(database._self) | ||
.then(function(response) { | ||
console.log('clean up completed'); | ||
}) | ||
.fail(function(error){ | ||
console.log(error); | ||
}); | ||
} | ||
</pre></p> | ||
<h4>Running the tests</h4> | ||
<p><pre> | ||
First You need to install mocha and q | ||
First You need to install mocha | ||
> npm install mocha | ||
> npm install q | ||
From the nodejsclient folder run | ||
From the tests folder run | ||
> mocha -t 0 -R spec | ||
</p></pre> | ||
</body> | ||
</html> | ||
</html> |
@@ -1,5 +0,5 @@ | ||
var masterKey = "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="; | ||
var host = "https://localhost:443"; | ||
var host = "MyHost"; | ||
var key = "MyKey"; | ||
exports.host = host; | ||
exports.masterKey = masterKey; | ||
exports.masterKey = key; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
0
29
100
0
236369
4063
67
2
- Removedq@*
- Removedasap@2.0.6(transitive)
- Removedpop-iterate@1.0.1(transitive)
- Removedq@2.0.3(transitive)
- Removedweak-map@1.0.8(transitive)