fix: query aggregation pipeline cannot handle value of type Date when directAccess: true (#8167)

This commit is contained in:
dblythy
2022-09-18 00:19:28 +10:00
committed by GitHub
parent cec3071170
commit e424137406
2 changed files with 20 additions and 0 deletions

View File

@@ -952,6 +952,9 @@ export class MongoStorageAdapter implements StorageAdapter {
// an operator in it (like $gt, $lt, etc). Because of this I felt it was easier to make this a
// recursive method to traverse down to the "leaf node" which is going to be the string.
_convertToDate(value: any): any {
if (value instanceof Date) {
return value;
}
if (typeof value === 'string') {
return new Date(value);
}