-
Type: Task
-
Resolution: Done
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
Empty show more show less
-
Not Needed
NODE-4016 Description
What problem are you facing?
Passing null as a value of a property of the scope object in mapReduce() ends with a NULL-reference error:
TypeError: Cannot read properties of null (reading '_bsontype') at processScope (.\node_modules\mongodb\lib\operations\map_reduce.js:157:29)
What driver and relevant dependency versions are you using?
4.3.1
Steps to reproduce?
const { MongoClient } = require("mongodb"); const uri = "mongodb://127.0.0.1/"; const client = new MongoClient(uri); async function run() { try { await client.connect(); const database = client.db('test'); const test = database.collection('test'); await test.mapReduce(null, null, {scope: {test: null}, out: 'inline'}); } finally { await client.close(); } } run().catch(console.dir);
- is depended on by
-
NODE-4016 NULL-reference error if a property in MapReduce `scope` is `null`
- Backlog