MongoDB Documentation, Release 3.0.4 In previous version, $maxDistance could be either inside or outside the $near document. For example, if a collection orders contains the following documents: If the collection has an index on the price field: db.orders.ensureIndex( { price: 1 } ) The following query uses the index to search for documents where price is not greater than or equal to 50 : { _id: 1, status: "A", cust_id: "123", price: 40 } { _id: 2, status: "A", cust_id: "xyz", price: "N/A" } { _id: 3, status: "D", cust_id: "xyz" } Geospatial Changes $maxDistance Changes Description Solution Deprecated $uniqueDocs Stronger Validation of Geospatial Queries Query Operator Changes $not Query Behavior Changes Description Description MongoDB 2.6 enforces a stronger validation of geospatial queries, such as validating the options or GeoJSON specifications, and errors if the geospatial query is invalid. Previous versions allowed/ignored invalid options. • Queries with $not expressions on an indexed field now match: – Documents that are missing the indexed field. Previous versions would not return these documents using the index. – Documents whose indexed field value is a different type than that of the specified value. Previous versions would not return these documents using the index. • For $near queries on GeoJSON data, if the queries specify a $maxDistance , $maxDistance must be inside of the $near document. • $maxDistance must be a positive value. • Update any existing $near queries on GeoJSON data that currently have the $maxDistance outside the $near document • Update any existing queries where $maxDistance is a negative value. Description MongoDB 2.6 deprecates $uniqueDocs , and geospatial queries no longer return duplicated results when a document matches the query multiple times. 863 12.2. Previous Stable Releases