Skip to content

Commit fb401cd

Browse files
added query support check
1 parent a7b9320 commit fb401cd

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/Database/Adapter/Mongo.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,17 +2475,19 @@ protected function buildFilter(Query $query): array
24752475
{
24762476
// Normalize extended ISO 8601 datetime strings in query values to UTCDateTime
24772477
// so they can be correctly compared against datetime fields stored in MongoDB.
2478-
$values = $query->getValues();
2479-
foreach ($values as $k => $value) {
2480-
if (is_string($value) && $this->isExtendedISODatetime($value)) {
2481-
try {
2482-
$values[$k] = $this->toMongoDatetime($value);
2483-
} catch (\Throwable $th) {
2484-
// Leave value as-is if it cannot be parsed as a datetime
2478+
if (!$this->getSupportForAttributes()) {
2479+
$values = $query->getValues();
2480+
foreach ($values as $k => $value) {
2481+
if (is_string($value) && $this->isExtendedISODatetime($value)) {
2482+
try {
2483+
$values[$k] = $this->toMongoDatetime($value);
2484+
} catch (\Throwable $th) {
2485+
// Leave value as-is if it cannot be parsed as a datetime
2486+
}
24852487
}
24862488
}
2489+
$query->setValues($values);
24872490
}
2488-
$query->setValues($values);
24892491

24902492
if ($query->getAttribute() === '$id') {
24912493
$query->setAttribute('_uid');

0 commit comments

Comments
 (0)