@@ -226,6 +226,22 @@ public interface MongoCollection<TDocument> {
226
226
/**
227
227
* Counts the number of documents in the collection.
228
228
*
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
+ *
229
245
* @param callback the callback passed the number of documents in the collection
230
246
* @since 3.8
231
247
*/
@@ -234,6 +250,22 @@ public interface MongoCollection<TDocument> {
234
250
/**
235
251
* Counts the number of documents in the collection according to the given options.
236
252
*
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
+ *
237
269
* @param filter the query filter
238
270
* @param callback the callback passed the number of documents in the collection
239
271
* @since 3.8
@@ -243,6 +275,22 @@ public interface MongoCollection<TDocument> {
243
275
/**
244
276
* Counts the number of documents in the collection according to the given options.
245
277
*
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
+ *
246
294
* @param filter the query filter
247
295
* @param options the options describing the count
248
296
* @param callback the callback passed the number of documents in the collection
@@ -253,6 +301,22 @@ public interface MongoCollection<TDocument> {
253
301
/**
254
302
* Counts the number of documents in the collection.
255
303
*
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
+ *
256
320
* @param clientSession the client session with which to associate this operation
257
321
* @param callback the callback passed the number of documents in the collection
258
322
* @since 3.8
@@ -263,6 +327,22 @@ public interface MongoCollection<TDocument> {
263
327
/**
264
328
* Counts the number of documents in the collection according to the given options.
265
329
*
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
+ *
266
346
* @param clientSession the client session with which to associate this operation
267
347
* @param filter the query filter
268
348
* @param callback the callback passed the number of documents in the collection
@@ -274,6 +354,22 @@ public interface MongoCollection<TDocument> {
274
354
/**
275
355
* Counts the number of documents in the collection according to the given options.
276
356
*
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
+ *
277
373
* @param clientSession the client session with which to associate this operation
278
374
* @param filter the query filter
279
375
* @param options the options describing the count
0 commit comments