Security fixes in samples and source/base.js
This commit is contained in:
Родитель
1ede9e9c88
Коммит
5b70d96263
|
@ -1,4 +1,5 @@
|
|||
console.log();
|
||||
'use strict';
|
||||
console.log();
|
||||
console.log('Azure DocumentDB Node.js Samples');
|
||||
console.log('================================');
|
||||
console.log();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
console.log();
|
||||
'use strict';
|
||||
console.log();
|
||||
console.log('Azure DocumentDB Node.js Samples');
|
||||
console.log('================================');
|
||||
console.log();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
console.log();
|
||||
'use strict';
|
||||
console.log();
|
||||
console.log('Azure DocumentDB Node.js Samples');
|
||||
console.log('================================');
|
||||
console.log();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
console.log();
|
||||
'use strict';
|
||||
console.log();
|
||||
console.log('Azure DocumentDB Node.js Samples');
|
||||
console.log('================================');
|
||||
console.log();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
console.log();
|
||||
'use strict';
|
||||
console.log();
|
||||
console.log('Azure DocumentDB Node.js Samples');
|
||||
console.log('================================');
|
||||
console.log();
|
||||
|
@ -154,7 +155,7 @@ function useRangePartitionResolver(databaseLink, callback) {
|
|||
{ "name": "Joe" }
|
||||
];
|
||||
|
||||
for (i = 0; i < documents.length; i++){
|
||||
for (var i = 0; i < documents.length; i++){
|
||||
collection_link = resolver.resolveForCreate(resolver.getPartitionKey(documents[i]));
|
||||
console.log(collection_link);
|
||||
}
|
||||
|
@ -364,7 +365,7 @@ function getOrCreateCollections(collectionIds, callback){
|
|||
collectionIds,
|
||||
|
||||
function iterator(collectionId, cb) {
|
||||
client.createCollection(databaseLink, {id: collectionId}, function (err, document, headers) {
|
||||
client.createCollection(databaseLink, { id: collectionId }, function (err, document, headers) {
|
||||
if (err) {
|
||||
if (err.code == 429) {
|
||||
var wait = headers["x-ms-retry-after-ms"] || 1000;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/**
|
||||
'use strict';
|
||||
/**
|
||||
* A DocumentDB stored procedure that upserts a given document (insert new or update if present) using its id property.<br/>
|
||||
* This implementation tries to create, and if the create fails then query for the document with the specified document's id, then replace it.
|
||||
* Use this sproc if creates are more common than replaces, otherwise use "upsertOptimizedForReplace"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
'use strict';
|
||||
console.log();
|
||||
console.log('Azure DocumentDB Node.js Samples');
|
||||
console.log('================================');
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
'use strict';
|
||||
var utils = {
|
||||
deleteDatabase: function (client, databaseLink, callback) {
|
||||
client.deleteDatabase(databaseLink, function (err) {
|
||||
|
|
|
@ -145,21 +145,6 @@ function derive(baseClass, constructor, instanceMembers, staticMembers) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines a class using the given constructor and the union of the set of instance members
|
||||
* specified by all the mixin objects. The mixin parameter list is of variable length.
|
||||
* @param {object} constructor - A constructor function that is used to instantiate this class.
|
||||
* @returns {Function} - The newly-defined class.
|
||||
*/
|
||||
function mix(constructor) {
|
||||
constructor = constructor || function () { };
|
||||
var i, len;
|
||||
for (i = 1, len = arguments.length; i < len; i++) {
|
||||
initializeProperties(constructor.prototype, arguments[i]);
|
||||
}
|
||||
return constructor;
|
||||
}
|
||||
|
||||
var Base = {
|
||||
NotImplementedException: "NotImplementedException",
|
||||
|
||||
|
@ -171,8 +156,6 @@ var Base = {
|
|||
|
||||
derive: derive,
|
||||
|
||||
mix: mix,
|
||||
|
||||
extend: function (obj, extent) {
|
||||
for (var property in extent) {
|
||||
if (typeof extent[property] !== "function") {
|
||||
|
|
Загрузка…
Ссылка в новой задаче