Skip to content

Commit fc05d29

Browse files
committed
Merge remote-tracking branch 'upstream/main' into JAVA-5744
# Conflicts: # driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java # driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java # driver-core/src/test/functional/com/mongodb/client/model/search/AggregatesSearchIntegrationTest.java # driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java # driver-scala/src/main/scala/org/mongodb/scala/model/search/SearchOperator.scala # driver-scala/src/main/scala/org/mongodb/scala/model/search/package.scala
2 parents 44c43e1 + 0e25654 commit fc05d29

File tree

24 files changed

+1396
-65
lines changed

24 files changed

+1396
-65
lines changed

driver-core/src/main/com/mongodb/ConnectionString.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,6 @@ public ConnectionString(final String connectionString, @Nullable final DnsClient
509509

510510
credential = createCredentials(combinedOptionsMaps, userName, password);
511511
warnOnUnsupportedOptions(combinedOptionsMaps);
512-
warnDeprecatedTimeouts(combinedOptionsMaps);
513512
}
514513

515514
private static final Set<String> GENERAL_OPTIONS_KEYS = new LinkedHashSet<>();
@@ -518,7 +517,6 @@ public ConnectionString(final String connectionString, @Nullable final DnsClient
518517
private static final Set<String> WRITE_CONCERN_KEYS = new HashSet<>();
519518
private static final Set<String> COMPRESSOR_KEYS = new HashSet<>();
520519
private static final Set<String> ALL_KEYS = new HashSet<>();
521-
private static final Set<String> DEPRECATED_TIMEOUT_KEYS = new HashSet<>();
522520

523521
static {
524522
GENERAL_OPTIONS_KEYS.add("minpoolsize");
@@ -592,10 +590,6 @@ public ConnectionString(final String connectionString, @Nullable final DnsClient
592590
ALL_KEYS.addAll(READ_PREFERENCE_KEYS);
593591
ALL_KEYS.addAll(WRITE_CONCERN_KEYS);
594592
ALL_KEYS.addAll(COMPRESSOR_KEYS);
595-
596-
DEPRECATED_TIMEOUT_KEYS.add("sockettimeoutms");
597-
DEPRECATED_TIMEOUT_KEYS.add("waitqueuetimeoutms");
598-
DEPRECATED_TIMEOUT_KEYS.add("wtimeoutms");
599593
}
600594

601595
// Any options contained in the connection string completely replace the corresponding options specified in TXT records,
@@ -616,15 +610,6 @@ private void warnOnUnsupportedOptions(final Map<String, List<String>> optionsMap
616610
.forEach(k -> LOGGER.warn(format("Connection string contains unsupported option '%s'.", k)));
617611
}
618612
}
619-
private void warnDeprecatedTimeouts(final Map<String, List<String>> optionsMap) {
620-
if (LOGGER.isWarnEnabled()) {
621-
optionsMap.keySet()
622-
.stream()
623-
.filter(DEPRECATED_TIMEOUT_KEYS::contains)
624-
.forEach(k -> LOGGER.warn(format("Use of deprecated timeout option: '%s'. Prefer 'timeoutMS' instead.", k)));
625-
}
626-
}
627-
628613

629614
private void translateOptions(final Map<String, List<String>> optionsMap) {
630615
boolean tlsInsecureSet = false;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright 2008-present MongoDB, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.mongodb.client.model.search;
17+
18+
import com.mongodb.annotations.Beta;
19+
import com.mongodb.annotations.Reason;
20+
import com.mongodb.annotations.Sealed;
21+
22+
import java.util.UUID;
23+
24+
import java.time.Instant;
25+
26+
import org.bson.types.ObjectId;
27+
28+
/**
29+
* @see SearchOperator#equals(FieldSearchPath, boolean)
30+
* @see SearchOperator#equals(FieldSearchPath, ObjectId)
31+
* @see SearchOperator#equals(FieldSearchPath, Number)
32+
* @see SearchOperator#equals(FieldSearchPath, Instant)
33+
* @see SearchOperator#equals(FieldSearchPath, String)
34+
* @see SearchOperator#equals(FieldSearchPath, UUID)
35+
* @see SearchOperator#equalsNull(FieldSearchPath)
36+
* @since 5.3
37+
*/
38+
@Sealed
39+
@Beta(Reason.CLIENT)
40+
public interface EqualsSearchOperator extends SearchOperator {
41+
@Override
42+
EqualsSearchOperator score(SearchScore modifier);
43+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2008-present MongoDB, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.mongodb.client.model.search;
17+
18+
import com.mongodb.annotations.Beta;
19+
import com.mongodb.annotations.Reason;
20+
import com.mongodb.annotations.Sealed;
21+
import org.bson.BsonDocument;
22+
23+
/**
24+
* @see SearchOperator#moreLikeThis(BsonDocument)
25+
* @see SearchOperator#moreLikeThis(Iterable)
26+
* @since 4.7
27+
*/
28+
@Sealed
29+
@Beta(Reason.CLIENT)
30+
public interface MoreLikeThisSearchOperator extends SearchOperator {
31+
@Override
32+
TextSearchOperator score(SearchScore modifier);
33+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright 2008-present MongoDB, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.mongodb.client.model.search;
17+
18+
import com.mongodb.annotations.Beta;
19+
import com.mongodb.annotations.Reason;
20+
import com.mongodb.annotations.Sealed;
21+
22+
/**
23+
* @see SearchOperator#queryString(FieldSearchPath, String)
24+
* @since 5.3
25+
*/
26+
@Sealed
27+
@Beta(Reason.CLIENT)
28+
public interface QueryStringSearchOperator extends SearchOperator {
29+
@Override
30+
QueryStringSearchOperator score(SearchScore modifier);
31+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2008-present MongoDB, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.mongodb.client.model.search;
17+
18+
import com.mongodb.annotations.Beta;
19+
import com.mongodb.annotations.Reason;
20+
import com.mongodb.annotations.Sealed;
21+
22+
/**
23+
* @see SearchOperator#regex(SearchPath, String)
24+
* @see SearchOperator#regex(Iterable, Iterable)
25+
* @since 5.3
26+
*/
27+
28+
@Sealed
29+
@Beta(Reason.CLIENT)
30+
public interface RegexSearchOperator extends SearchOperator {
31+
@Override
32+
RegexSearchOperator score(SearchScore modifier);
33+
}

driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
final class SearchConstructibleBsonElement extends AbstractConstructibleBsonElement<SearchConstructibleBsonElement> implements
3232
MustCompoundSearchOperator, MustNotCompoundSearchOperator, ShouldCompoundSearchOperator, FilterCompoundSearchOperator,
3333
ExistsSearchOperator, TextSearchOperator, AutocompleteSearchOperator,
34-
NumberNearSearchOperator, DateNearSearchOperator, GeoNearSearchOperator, InSearchOperator,
34+
NumberNearSearchOperator, DateNearSearchOperator, GeoNearSearchOperator,
35+
EqualsSearchOperator, InSearchOperator, MoreLikeThisSearchOperator,
36+
RegexSearchOperator, QueryStringSearchOperator, WildcardSearchOperator,
3537
ValueBoostSearchScore, PathBoostSearchScore, ConstantSearchScore, FunctionSearchScore,
3638
GaussSearchScoreExpression, PathSearchScoreExpression,
3739
FacetSearchCollector,

0 commit comments

Comments
 (0)