(str)
| 77 | } |
| 78 | |
| 79 | function stringToMongoObjectId(str) { |
| 80 | let idValue = str.match(objectIdAsStringRegex); |
| 81 | if (idValue && idValue[1] && ObjectId.isValid(idValue[1])) { |
| 82 | return new ObjectId(idValue[1]); |
| 83 | } |
| 84 | return str; |
| 85 | } |
| 86 | |
| 87 | // usually, we won't pass any options because we want to get whole documents |
| 88 | async function getCurrentMongoDocs(collection, query, options = {}) { |
no test coverage detected