===== $near ===== .. default-domain:: mongodb .. contents:: On this page :local: :backlinks: none :depth: 1 :class: singlecol .. query:: $near The :query:`$near` operator takes an argument, coordinates for a point in the form of ``[x, y]``, and returns a list of objects sorted by distance from nearest to farthest with respect to those coordinates. See the following example: .. code-block:: javascript db.collection.find( { location: { $near: [100,100] } } ); This query will return 100 ordered records with a ``location`` field in ``collection``. Specify a different limit using the :method:`cursor.limit()`, or another :ref:`geolocation operator `, or a non-geospatial operator to limit the results of the query. .. note:: Specifying a batch size (i.e. :method:`batchSize() `) in conjunction with queries that use the :query:`$near` is not defined. See :issue:`SERVER-5236` for more information. .. include:: /includes/note-geospatial-index-must-exist.rst