Skip to content

Commit 4b541c3

Browse files
committed
Updated Javadoc to document restrictions for geo commands
JAVA-2893
1 parent 53c4379 commit 4b541c3

File tree

2 files changed

+192
-0
lines changed

2 files changed

+192
-0
lines changed

driver-async/src/main/com/mongodb/async/client/MongoCollection.java

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

driver-sync/src/main/com/mongodb/client/MongoCollection.java

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,22 @@ public interface MongoCollection<TDocument> {
224224
/**
225225
* Counts the number of documents in the collection.
226226
*
227+
* <p>
228+
* Note: When migrating from {@code count()} to {@code countDocuments()} the following query operators must be replaced:
229+
* </p>
230+
* <pre>
231+
*
232+
* +-------------+--------------------------------+
233+
* | Operator | Replacement |
234+
* +=============+================================+
235+
* | $where | $expr |
236+
* +-------------+--------------------------------+
237+
* | $near | $geoWithin with $center |
238+
* +-------------+--------------------------------+
239+
* | $nearSphere | $geoWithin with $centerSphere |
240+
* +-------------+--------------------------------+
241+
* </pre>
242+
*
227243
* @return the number of documents in the collection
228244
* @since 3.8
229245
*/
@@ -232,6 +248,22 @@ public interface MongoCollection<TDocument> {
232248
/**
233249
* Counts the number of documents in the collection according to the given options.
234250
*
251+
* <p>
252+
* Note: When migrating from {@code count()} to {@code countDocuments()} the following query operators must be replaced:
253+
* </p>
254+
* <pre>
255+
*
256+
* +-------------+--------------------------------+
257+
* | Operator | Replacement |
258+
* +=============+================================+
259+
* | $where | $expr |
260+
* +-------------+--------------------------------+
261+
* | $near | $geoWithin with $center |
262+
* +-------------+--------------------------------+
263+
* | $nearSphere | $geoWithin with $centerSphere |
264+
* +-------------+--------------------------------+
265+
* </pre>
266+
*
235267
* @param filter the query filter
236268
* @return the number of documents in the collection
237269
* @since 3.8
@@ -241,6 +273,22 @@ public interface MongoCollection<TDocument> {
241273
/**
242274
* Counts the number of documents in the collection according to the given options.
243275
*
276+
* <p>
277+
* Note: When migrating from {@code count()} to {@code countDocuments()} the following query operators must be replaced:
278+
* </p>
279+
* <pre>
280+
*
281+
* +-------------+--------------------------------+
282+
* | Operator | Replacement |
283+
* +=============+================================+
284+
* | $where | $expr |
285+
* +-------------+--------------------------------+
286+
* | $near | $geoWithin with $center |
287+
* +-------------+--------------------------------+
288+
* | $nearSphere | $geoWithin with $centerSphere |
289+
* +-------------+--------------------------------+
290+
* </pre>
291+
*
244292
* @param filter the query filter
245293
* @param options the options describing the count
246294
* @return the number of documents in the collection
@@ -251,6 +299,22 @@ public interface MongoCollection<TDocument> {
251299
/**
252300
* Counts the number of documents in the collection.
253301
*
302+
* <p>
303+
* Note: When migrating from {@code count()} to {@code countDocuments()} the following query operators must be replaced:
304+
* </p>
305+
* <pre>
306+
*
307+
* +-------------+--------------------------------+
308+
* | Operator | Replacement |
309+
* +=============+================================+
310+
* | $where | $expr |
311+
* +-------------+--------------------------------+
312+
* | $near | $geoWithin with $center |
313+
* +-------------+--------------------------------+
314+
* | $nearSphere | $geoWithin with $centerSphere |
315+
* +-------------+--------------------------------+
316+
* </pre>
317+
*
254318
* @param clientSession the client session with which to associate this operation
255319
* @return the number of documents in the collection
256320
* @since 3.8
@@ -261,6 +325,22 @@ public interface MongoCollection<TDocument> {
261325
/**
262326
* Counts the number of documents in the collection according to the given options.
263327
*
328+
* <p>
329+
* Note: When migrating from {@code count()} to {@code countDocuments()} the following query operators must be replaced:
330+
* </p>
331+
* <pre>
332+
*
333+
* +-------------+--------------------------------+
334+
* | Operator | Replacement |
335+
* +=============+================================+
336+
* | $where | $expr |
337+
* +-------------+--------------------------------+
338+
* | $near | $geoWithin with $center |
339+
* +-------------+--------------------------------+
340+
* | $nearSphere | $geoWithin with $centerSphere |
341+
* +-------------+--------------------------------+
342+
* </pre>
343+
*
264344
* @param clientSession the client session with which to associate this operation
265345
* @param filter the query filter
266346
* @return the number of documents in the collection
@@ -272,6 +352,22 @@ public interface MongoCollection<TDocument> {
272352
/**
273353
* Counts the number of documents in the collection according to the given options.
274354
*
355+
* <p>
356+
* Note: When migrating from {@code count()} to {@code countDocuments()} the following query operators must be replaced:
357+
* </p>
358+
* <pre>
359+
*
360+
* +-------------+--------------------------------+
361+
* | Operator | Replacement |
362+
* +=============+================================+
363+
* | $where | $expr |
364+
* +-------------+--------------------------------+
365+
* | $near | $geoWithin with $center |
366+
* +-------------+--------------------------------+
367+
* | $nearSphere | $geoWithin with $centerSphere |
368+
* +-------------+--------------------------------+
369+
* </pre>
370+
*
275371
* @param clientSession the client session with which to associate this operation
276372
* @param filter the query filter
277373
* @param options the options describing the count

0 commit comments

Comments
 (0)