-
Type:
Task
-
Resolution: Won't Do
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
Use Case
As a Developer
I want the driver to use an injected stream adapter.
So that I can use the driver in environments that do not support the full Node.js stream module.
User Experience
- Driver uses provided stream adapter for operations like GridFS or Cursor streaming instead of require('stream').
Risks/Unknowns
Mapping Node.js streams to non-Node environments (like Web Streams) is complex. The adapter should simply require a Node-compatible polyfill (like readable-stream) rather than re-implementing the logic.
Acceptance Criteria
Implementation Requirements
- Remove import: Remove require('stream') from all places inside src folder.
Testing Requirements
- Verify cursors, gridfs (which are streams) still function correctly (data events, piping) using the adapter.
- Ensure node:stream is not loaded at runtime.
Documentation Requirements
- DOCSP ticket, API docs, etc
Follow Up Requirements
- additional tickets to file, required releases, etc
- if node behavior differs/will differ from other drivers, confirm with dbx devs what standard to aim for and what plan, if any, exists to reconcile the diverging behavior moving forward