-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Diagnostics
-
Fully Compatible
-
v3.4
-
Query 2016-12-12, Query 2017-01-23
It's currently not possible to use $natural in aggregation to force a "natural sort order". However, if a user attempts a $natural sort when running the find command on a view, they'll get this fairly unnatural-looking error message:
> db.view.find().sort( { $natural: 1 } ) Error: error: { "ok" : 0, "errmsg" : "FieldPath field names may not start with '$'.", "code" : 16410, "codeName" : "Location16410" }
We should consider whether or not to detect this up-front in order to produce a clearer error message for the user.
- is related to
-
SERVER-27492 Support $natural sorts on views
- Closed