-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.5.4
-
Component/s: None
-
Empty show more show less
It seems like when I use the cursor as a read stream and I use `map` on the cursor, the map function is applied twice.
Example:
client.collection('xxx') .find() .project({ _id: 1 }) .map(doc => {}} return { doc: doc }; }) .on('data', x => console.log('data', x));
Output:
data { doc: { doc: { _id: '5bb55dd0d6eb334f45811b8e' } } } data { doc: { doc: { _id: '5c54e86c7e37c22ce904cd71' } } } data { doc: { doc: { _id: '5c5dcaec66b2983808d4b1bb' } } } data { doc: { doc: { _id: '5c953939a1650802df5b28fa' } } } data { doc: { doc: { _id: '5c968877c666b318f01a84c0' } } } data { doc: { doc: { _id: '5c953300654c60739c20f783' } } }
Expected:
data { doc: { _id: '5bb55dd0d6eb334f45811b8e' } } data { doc: { _id: '5c54e86c7e37c22ce904cd71' } } data { doc: { _id: '5c5dcaec66b2983808d4b1bb' } } data { doc: { _id: '5c953939a1650802df5b28fa' } } data { doc: { _id: '5c968877c666b318f01a84c0' } } data { doc: { _id: '5c953300654c60739c20f783' } }