-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 0.12.1
-
Component/s: CLI Module
-
None
-
Iteration Chicago
-
Not Needed
-
Problem Description
config.set("inspectDepth", VALUE) should accept positive integers and javascript Infinity. However, it also accepts other values.
Steps to Reproduce
See below for examples and expected results.
Expected Results
Only positive integers and Infinity accepted
Actual Results
0, negative integers, random strings, arrays, are accepted
Additional Notes
// 0 integer values (maybe this has a useful meaning?)
Enterprise rs0 [direct: primary]> config.set("inspectDepth", 0)
Setting "inspectDepth" has been changed
Enterprise rs0 [direct: primary]> db.depth.find({})
[ [Object] ]
// Negative value (maybe this has a useful meaning?)
Enterprise rs0 [direct: primary]> config.set("inspectDepth", -3)
Setting "inspectDepth" has been changed
Enterprise rs0 [direct: primary]> db.depth.find({})
[Array]
// string
Enterprise rs0 [direct: primary]> config.set("inspectDepth", "AAA")
Setting "inspectDepth" has been changed
Enterprise rs0 [direct: primary]> db.depth.find({})
[
{
_id: ObjectId("60956cac51d4986dc3189e57"),
a: {
b: {
c: { d: { e:
{ f: 1 }} }
}
}
}
]
// Int as string
Enterprise rs0 [direct: primary]> config.set("inspectDepth", "2")
Setting "inspectDepth" has been changed
Enterprise rs0 [direct: primary]> db.depth.find({})
[ { _id: ObjectId("60956cac51d4986dc3189e57"), a:
{ b: [Object] }} ]
// array (also char arrays)
Enterprise rs0 [direct: primary]> config.set("inspectDepth", [1, 5])
Setting "inspectDepth" has been changed
Enterprise rs0 [direct: primary]> db.depth.find({})
[
{
_id: ObjectId("60956cac51d4986dc3189e57"),
a: {
b: {
c: { d: { e:
{ f: 1 }} }
}
}
}
]