mongo-express
Advanced tools
Comparing version 0.30.47 to 0.30.48
@@ -57,8 +57,8 @@ 'use strict'; | ||
*/ | ||
{ | ||
database: process.env.ME_CONFIG_MONGODB_AUTH_DATABASE || mongo.db, | ||
username: process.env.ME_CONFIG_MONGODB_AUTH_USERNAME || mongo.username, | ||
password: process.env.ME_CONFIG_MONGODB_AUTH_PASSWORD || mongo.password, | ||
}, | ||
], | ||
{ | ||
database: process.env.ME_CONFIG_MONGODB_AUTH_DATABASE || mongo.db, | ||
username: process.env.ME_CONFIG_MONGODB_AUTH_USERNAME || mongo.username, | ||
password: process.env.ME_CONFIG_MONGODB_AUTH_PASSWORD || mongo.password, | ||
}, | ||
], | ||
@@ -65,0 +65,0 @@ // >>>> If you are using an admin mongodb account, or no admin account exists, fill out section below |
@@ -0,1 +1,5 @@ | ||
0.30.48 | ||
------- | ||
* Add support for super large Objects | ||
0.21.0 | ||
@@ -2,0 +6,0 @@ ------ |
@@ -26,3 +26,3 @@ 'use strict'; | ||
} else { | ||
db = new mongodb.Db('local', new mongodb.Server(host, port, dbOptions), { safe:true }); | ||
db = new mongodb.Db('local', new mongodb.Server(host, port, dbOptions), { safe: true }); | ||
} | ||
@@ -29,0 +29,0 @@ |
136
lib/json.js
@@ -123,98 +123,98 @@ 'use strict'; | ||
switch (typeof value) { | ||
case 'string': | ||
return quote(value); | ||
case 'string': | ||
return quote(value); | ||
case 'number': | ||
case 'number': | ||
// JSON numbers must be finite. Encode non-finite numbers as null. | ||
// JSON numbers must be finite. Encode non-finite numbers as null. | ||
return isFinite(value) ? String(value) : 'null'; | ||
return isFinite(value) ? String(value) : 'null'; | ||
case 'boolean': | ||
case 'null': | ||
case 'boolean': | ||
case 'null': | ||
// If the value is a boolean or null, convert it to a string. Note: | ||
// typeof null does not produce 'null'. The case is included here in | ||
// the remote chance that this gets fixed someday. | ||
// If the value is a boolean or null, convert it to a string. Note: | ||
// typeof null does not produce 'null'. The case is included here in | ||
// the remote chance that this gets fixed someday. | ||
return String(value); | ||
return String(value); | ||
// If the type is 'object', we might be dealing with an object or an array or | ||
// null. | ||
// If the type is 'object', we might be dealing with an object or an array or | ||
// null. | ||
case 'object': | ||
case 'object': | ||
// Due to a specification blunder in ECMAScript, typeof null is 'object', | ||
// so watch out for that case. | ||
// Due to a specification blunder in ECMAScript, typeof null is 'object', | ||
// so watch out for that case. | ||
if (!value) { | ||
return 'null'; | ||
} | ||
if (!value) { | ||
return 'null'; | ||
} | ||
// Make an array to hold the partial results of stringifying this object value. | ||
// Make an array to hold the partial results of stringifying this object value. | ||
gap += indent; | ||
partial = []; | ||
gap += indent; | ||
partial = []; | ||
// Is the value an array? | ||
// Is the value an array? | ||
if (Object.prototype.toString.apply(value) === '[object Array]') { | ||
if (Object.prototype.toString.apply(value) === '[object Array]') { | ||
// The value is an array. Stringify every element. Use null as a placeholder | ||
// for non-JSON values. | ||
// The value is an array. Stringify every element. Use null as a placeholder | ||
// for non-JSON values. | ||
length = value.length; | ||
for (i = 0; i < length; i += 1) { | ||
partial[i] = str(i, value) || 'null'; | ||
} | ||
length = value.length; | ||
for (i = 0; i < length; i += 1) { | ||
partial[i] = str(i, value) || 'null'; | ||
} | ||
// Join all of the elements together, separated with commas, and wrap them in | ||
// brackets. | ||
// Join all of the elements together, separated with commas, and wrap them in | ||
// brackets. | ||
v = partial.length === 0 ? | ||
'[]' : | ||
gap ? | ||
'[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : | ||
'[' + partial.join(',') + ']'; | ||
gap = mind; | ||
return v; | ||
} | ||
v = partial.length === 0 ? | ||
'[]' : | ||
gap ? | ||
'[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : | ||
'[' + partial.join(',') + ']'; | ||
gap = mind; | ||
return v; | ||
} | ||
// If the replacer is an array, use it to select the members to be stringified. | ||
// If the replacer is an array, use it to select the members to be stringified. | ||
if (rep && typeof rep === 'object') { | ||
length = rep.length; | ||
for (i = 0; i < length; i += 1) { | ||
if (typeof rep[i] === 'string') { | ||
k = rep[i]; | ||
v = str(k, value); | ||
if (v) { | ||
partial.push(quote(k) + (gap ? ': ' : ':') + v); | ||
if (rep && typeof rep === 'object') { | ||
length = rep.length; | ||
for (i = 0; i < length; i += 1) { | ||
if (typeof rep[i] === 'string') { | ||
k = rep[i]; | ||
v = str(k, value); | ||
if (v) { | ||
partial.push(quote(k) + (gap ? ': ' : ':') + v); | ||
} | ||
} | ||
} | ||
} | ||
} else { | ||
} else { | ||
// Otherwise, iterate through all of the keys in the object. | ||
// Otherwise, iterate through all of the keys in the object. | ||
for (k in value) { | ||
if (Object.prototype.hasOwnProperty.call(value, k)) { | ||
v = str(k, value); | ||
if (v) { | ||
partial.push(quote(k) + (gap ? ': ' : ':') + v); | ||
for (k in value) { | ||
if (Object.prototype.hasOwnProperty.call(value, k)) { | ||
v = str(k, value); | ||
if (v) { | ||
partial.push(quote(k) + (gap ? ': ' : ':') + v); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
// Join all of the member texts together, separated with commas, | ||
// and wrap them in braces. | ||
// Join all of the member texts together, separated with commas, | ||
// and wrap them in braces. | ||
v = partial.length === 0 ? | ||
'{}' : | ||
gap ? | ||
'{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : | ||
'{' + partial.join(',') + '}'; | ||
gap = mind; | ||
return v; | ||
v = partial.length === 0 ? | ||
'{}' : | ||
gap ? | ||
'{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : | ||
'{' + partial.join(',') + '}'; | ||
gap = mind; | ||
return v; | ||
} | ||
@@ -245,3 +245,3 @@ } | ||
// If the space parameter is a string, it will be used as the indent string. | ||
// If the space parameter is a string, it will be used as the indent string. | ||
@@ -248,0 +248,0 @@ } else if (typeof space === 'string') { |
@@ -100,2 +100,9 @@ 'use strict'; | ||
exp.deleteDocument = function (req, res) { | ||
const skip = req.query.skip || ''; | ||
const key = req.query.key || ''; | ||
const value = req.query.value || ''; | ||
const type = req.query.type || ''; | ||
const jsonQuery = req.query.query || ''; | ||
const jsonProjection = req.query.projection || ''; | ||
req.collection.remove(req.document, { safe: true }, function (err) { | ||
@@ -109,3 +116,4 @@ if (err) { | ||
req.session.success = 'Document deleted! _id: ' + req.document._id; | ||
res.redirect(res.locals.baseHref + 'db/' + req.dbName + '/' + req.collectionName); | ||
res.redirect(res.locals.baseHref + 'db/' + req.dbName + '/' + req.collectionName + | ||
`?skip=${skip}&key=${key}&value=${value}&type=${type}&query=${jsonQuery}&projection=${jsonProjection}`); | ||
}); | ||
@@ -112,0 +120,0 @@ }; |
{ | ||
"version": "0.30.47", | ||
"version": "0.30.48", | ||
"author": "https://github.com/mongo-express", | ||
@@ -4,0 +4,0 @@ "name": "mongo-express", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
2396101
21919