Skip to content

Commit c2c7f6a

Browse files
committed
Deprecate hint as string for count
JAVA-3030
1 parent a9f0fc3 commit c2c7f6a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ public Bson getHint() {
5151
* Gets the hint string to apply.
5252
*
5353
* @return the hint string, which should be the name of an existing index
54+
* @deprecated Prefer {@link #getHint()}
5455
*/
56+
@Deprecated
5557
@Nullable
5658
public String getHintString() {
5759
return hintString;
@@ -73,7 +75,9 @@ public CountOptions hint(@Nullable final Bson hint) {
7375
*
7476
* @param hint the name of the index which should be used for the operation
7577
* @return this
78+
* @deprecated Prefer {@link #hint(Bson)}
7679
*/
80+
@Deprecated
7781
public CountOptions hintString(@Nullable final String hint) {
7882
this.hintString = hint;
7983
return this;

driver-legacy/src/main/com/mongodb/client/model/DBCollectionCountOptions.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ public DBObject getHint() {
6262
* Gets the hint string to apply.
6363
*
6464
* @return the hint string, which should be the name of an existing index
65+
* @deprecated Prefer {@link #getHint()}
6566
*/
67+
@Deprecated
6668
@Nullable
6769
public String getHintString() {
6870
return hintString;
@@ -84,7 +86,9 @@ public DBCollectionCountOptions hint(@Nullable final DBObject hint) {
8486
*
8587
* @param hint the name of the index which should be used for the operation
8688
* @return this
89+
* @deprecated Prefer {@link #hint(DBObject)}
8790
*/
91+
@Deprecated
8892
public DBCollectionCountOptions hintString(@Nullable final String hint) {
8993
this.hintString = hint;
9094
return this;

0 commit comments

Comments
 (0)