Skip to content

Commit 3832366

Browse files
committed
Deprecate DBCollection methods that take a projection
The projection parameter is unused so these methods are unnecessary. JAVA-3049
1 parent b9acc05 commit 3832366

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

driver-legacy/src/main/com/mongodb/DBCollection.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,9 @@ public long getCount(@Nullable final DBObject query) {
938938
* @return the number of documents that matches selection criteria
939939
* @throws MongoException if the operation failed
940940
* @mongodb.driver.manual reference/command/count/ Count
941+
* @deprecated Prefer {@link #count(DBObject, DBCollectionCountOptions)}
941942
*/
943+
@Deprecated
942944
public long getCount(@Nullable final DBObject query, final DBObject projection) {
943945
return getCount(query, projection, 0, 0);
944946
}
@@ -952,7 +954,9 @@ public long getCount(@Nullable final DBObject query, final DBObject projection)
952954
* @return the number of documents that matches selection criteria
953955
* @throws MongoException if the operation failed
954956
* @mongodb.driver.manual reference/command/count/ Count
957+
* @deprecated Prefer {@link #count(DBObject, DBCollectionCountOptions)}
955958
*/
959+
@Deprecated
956960
public long getCount(@Nullable final DBObject query, @Nullable final DBObject projection, final ReadPreference readPreference) {
957961
return getCount(query, projection, 0, 0, readPreference);
958962
}
@@ -967,7 +971,9 @@ public long getCount(@Nullable final DBObject query, @Nullable final DBObject pr
967971
* @return the number of documents that matches selection criteria
968972
* @throws MongoException if the operation failed
969973
* @mongodb.driver.manual reference/command/count/ Count
974+
* @deprecated Prefer {@link #count(DBObject, DBCollectionCountOptions)}
970975
*/
976+
@Deprecated
971977
public long getCount(@Nullable final DBObject query, @Nullable final DBObject projection, final long limit, final long skip) {
972978
return getCount(query, projection, limit, skip, getReadPreference());
973979
}
@@ -983,7 +989,9 @@ public long getCount(@Nullable final DBObject query, @Nullable final DBObject pr
983989
* @return the number of documents that matches selection criteria
984990
* @throws MongoException if the operation failed
985991
* @mongodb.driver.manual reference/command/count/ Count
992+
* @deprecated Prefer {@link #count(DBObject, DBCollectionCountOptions)}
986993
*/
994+
@Deprecated
987995
public long getCount(@Nullable final DBObject query, @Nullable final DBObject projection, final long limit, final long skip,
988996
final ReadPreference readPreference) {
989997
return getCount(query, new DBCollectionCountOptions().limit(limit).skip(skip).readPreference(readPreference));

0 commit comments

Comments
 (0)