JS: Use type info in mongodb/mongoose model

This commit is contained in:
Asger F
2019-09-02 10:18:59 +01:00
parent 8e397ad203
commit ea446f2aa1
5 changed files with 45 additions and 0 deletions

View File

@@ -77,6 +77,18 @@ private module MongoDB {
}
}
/**
* A collection based on the type `mongodb.Collection`.
*
* Note that this also covers `mongoose` models since they are subtypes
* of `mongodb.Collection`.
*/
private class CollectionFromType extends Collection {
CollectionFromType() {
hasUnderlyingType("mongodb", "Collection")
}
}
/** Gets a data flow node referring to a MongoDB collection. */
private DataFlow::SourceNode getACollection(DataFlow::TypeTracker t) {
t.start() and