-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Native
-
Empty show more show less
The Db type is meant simply to be a layer for holding the database name, and some convenience methods you would run against a database. Instead, the Db object has too much context, and maintains legacy behavior like forwarding topology events. This is because it used to be the object returned from connect. The way it's currently written, it is impossible to provide the following user experience without breaking compatibility:
const client = new MongoClient('mongodb://localhost/test'); const coll = client.db('test').collection('test'); coll.find().toArray(docs => console.dir(docs));
- depends on
-
NODE-1726 Deprecate Topology events in `Db`
- Closed