|
28 | 28 | import java.util.function.BinaryOperator; |
29 | 29 | import java.util.function.Function; |
30 | 30 |
|
| 31 | +import static com.mongodb.assertions.Assertions.fail; |
31 | 32 | import static com.mongodb.client.model.mql.MqlValues.of; |
32 | 33 | import static com.mongodb.client.model.mql.MqlValues.ofNull; |
33 | 34 | import static com.mongodb.client.model.mql.MqlValues.ofStringArray; |
@@ -953,6 +954,12 @@ public MqlString asString(final MqlString timezone, final MqlString format) { |
953 | 954 | .append("timezone", toBsonValue(cr, timezone)))); |
954 | 955 | } |
955 | 956 |
|
| 957 | + public MqlString asString(final MqlString timezone) { |
| 958 | + // Given that server versions < 7.1 return a wrong format, not implementing this method helps prevent users |
| 959 | + // from encountering the bug, described in DRIVERS-2620, by avoiding the method that requires a format as a parameter. |
| 960 | + throw fail(); |
| 961 | + } |
| 962 | + |
956 | 963 | @Override |
957 | 964 | public MqlDate parseDate(final MqlString timezone, final MqlString format) { |
958 | 965 | Assertions.notNull("timezone", timezone); |
|
0 commit comments