Move _collections into static namespace

This commit is contained in:
Jørgen Vatle
2024-06-29 22:18:04 +03:00
parent b9bdc227f4
commit 5cd8699e88

View File

@@ -27,12 +27,6 @@ export function warnUsingOldApi(methodName, collectionName, isCalledFromAsync) {
*/
Mongo = {};
/**
* @summary A record of all defined collections
* @type {Map<string, Mongo.Collection>}
*/
Mongo._collections = new Map();
/**
* @summary Constructor for a Collection
* @locus Anywhere
@@ -529,6 +523,13 @@ Object.assign(Mongo.Collection, {
return selector;
},
/**
* @summary A record of all defined Mongo.Collection instances, indexed by collection name.
* @type {Map<string, Mongo.Collection>}
* @protected
*/
_collections: new Map(),
});
Object.assign(Mongo.Collection.prototype, {