@@ -226,6 +226,22 @@ public interface MongoCollection<TDocument> {
226226 /**
227227 * Counts the number of documents in the collection.
228228 *
229+ * <p>
230+ * Note: When migrating from {@code count()} to {@code countDocuments()} the following query operators must be replaced:
231+ * </p>
232+ * <pre>
233+ *
234+ * +-------------+--------------------------------+
235+ * | Operator | Replacement |
236+ * +=============+================================+
237+ * | $where | $expr |
238+ * +-------------+--------------------------------+
239+ * | $near | $geoWithin with $center |
240+ * +-------------+--------------------------------+
241+ * | $nearSphere | $geoWithin with $centerSphere |
242+ * +-------------+--------------------------------+
243+ * </pre>
244+ *
229245 * @param callback the callback passed the number of documents in the collection
230246 * @since 3.8
231247 */
@@ -234,6 +250,22 @@ public interface MongoCollection<TDocument> {
234250 /**
235251 * Counts the number of documents in the collection according to the given options.
236252 *
253+ * <p>
254+ * Note: When migrating from {@code count()} to {@code countDocuments()} the following query operators must be replaced:
255+ * </p>
256+ * <pre>
257+ *
258+ * +-------------+--------------------------------+
259+ * | Operator | Replacement |
260+ * +=============+================================+
261+ * | $where | $expr |
262+ * +-------------+--------------------------------+
263+ * | $near | $geoWithin with $center |
264+ * +-------------+--------------------------------+
265+ * | $nearSphere | $geoWithin with $centerSphere |
266+ * +-------------+--------------------------------+
267+ * </pre>
268+ *
237269 * @param filter the query filter
238270 * @param callback the callback passed the number of documents in the collection
239271 * @since 3.8
@@ -243,6 +275,22 @@ public interface MongoCollection<TDocument> {
243275 /**
244276 * Counts the number of documents in the collection according to the given options.
245277 *
278+ * <p>
279+ * Note: When migrating from {@code count()} to {@code countDocuments()} the following query operators must be replaced:
280+ * </p>
281+ * <pre>
282+ *
283+ * +-------------+--------------------------------+
284+ * | Operator | Replacement |
285+ * +=============+================================+
286+ * | $where | $expr |
287+ * +-------------+--------------------------------+
288+ * | $near | $geoWithin with $center |
289+ * +-------------+--------------------------------+
290+ * | $nearSphere | $geoWithin with $centerSphere |
291+ * +-------------+--------------------------------+
292+ * </pre>
293+ *
246294 * @param filter the query filter
247295 * @param options the options describing the count
248296 * @param callback the callback passed the number of documents in the collection
@@ -253,6 +301,22 @@ public interface MongoCollection<TDocument> {
253301 /**
254302 * Counts the number of documents in the collection.
255303 *
304+ * <p>
305+ * Note: When migrating from {@code count()} to {@code countDocuments()} the following query operators must be replaced:
306+ * </p>
307+ * <pre>
308+ *
309+ * +-------------+--------------------------------+
310+ * | Operator | Replacement |
311+ * +=============+================================+
312+ * | $where | $expr |
313+ * +-------------+--------------------------------+
314+ * | $near | $geoWithin with $center |
315+ * +-------------+--------------------------------+
316+ * | $nearSphere | $geoWithin with $centerSphere |
317+ * +-------------+--------------------------------+
318+ * </pre>
319+ *
256320 * @param clientSession the client session with which to associate this operation
257321 * @param callback the callback passed the number of documents in the collection
258322 * @since 3.8
@@ -263,6 +327,22 @@ public interface MongoCollection<TDocument> {
263327 /**
264328 * Counts the number of documents in the collection according to the given options.
265329 *
330+ * <p>
331+ * Note: When migrating from {@code count()} to {@code countDocuments()} the following query operators must be replaced:
332+ * </p>
333+ * <pre>
334+ *
335+ * +-------------+--------------------------------+
336+ * | Operator | Replacement |
337+ * +=============+================================+
338+ * | $where | $expr |
339+ * +-------------+--------------------------------+
340+ * | $near | $geoWithin with $center |
341+ * +-------------+--------------------------------+
342+ * | $nearSphere | $geoWithin with $centerSphere |
343+ * +-------------+--------------------------------+
344+ * </pre>
345+ *
266346 * @param clientSession the client session with which to associate this operation
267347 * @param filter the query filter
268348 * @param callback the callback passed the number of documents in the collection
@@ -274,6 +354,22 @@ public interface MongoCollection<TDocument> {
274354 /**
275355 * Counts the number of documents in the collection according to the given options.
276356 *
357+ * <p>
358+ * Note: When migrating from {@code count()} to {@code countDocuments()} the following query operators must be replaced:
359+ * </p>
360+ * <pre>
361+ *
362+ * +-------------+--------------------------------+
363+ * | Operator | Replacement |
364+ * +=============+================================+
365+ * | $where | $expr |
366+ * +-------------+--------------------------------+
367+ * | $near | $geoWithin with $center |
368+ * +-------------+--------------------------------+
369+ * | $nearSphere | $geoWithin with $centerSphere |
370+ * +-------------+--------------------------------+
371+ * </pre>
372+ *
277373 * @param clientSession the client session with which to associate this operation
278374 * @param filter the query filter
279375 * @param options the options describing the count
0 commit comments