-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: JavaScript
-
None
-
Fully Compatible
-
ALL
-
v3.2, v3.0
-
Platforms 18 (08/05/16)
-
0
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Ran into this issue adapting mongo-perf to run some internal bench marks. A query op such as this:
ops : [
{ op: "find",
ns: "app-test.emails",
query: {
accountId: "12345-67890-12345-67890",
_type: { $ne: null }
}
}
]
produces the following error:
Error running test [object Object]: Cannot use 'in' operator to search for 'floatApprox' in null:TypeError: Cannot use 'in' operator to search for 'floatApprox' in null at Function.Object.extend (src/mongo/shell/types.js:228:34) at Function.Object.extend (src/mongo/shell/types.js:231:28) at Function.Object.extend (src/mongo/shell/types.js:231:28) at util/utils.js:86:29 at Array.forEach (native) at runTest (util/utils.js:82:14) at runTests (util/utils.js:369:38) at mongoPerfRunTests (util/utils.js:421:19) at (shell):1:1
The issue is that in javascript:
[00:09:51] tim@Timo:~/src/mongo $ node > typeof(null) 'object'
and the code being modified in the PR is trying to deep copy an object, verifying the property is an object by using typeof().
- links to