-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.4.4
-
Component/s: Querying
-
None
-
ALL
when field name is number,sort the result like this:
db.test.find().sort({"505":-1,"504":1 });
,and the result is:
{ "_id" : ObjectId("5ac30f8761d473226afba2f3"), "503" : "12asdt", "504" : 10, "505" : 0.12, "506" : 10 } /* 2 */ { "_id" : ObjectId("5ac2de8ab25cfdcfa67ddeca"), "503" : "abdc", "504" : 12, "505" : 12.3, "506" : 12 } /* 3 */ { "_id" : ObjectId("5ac2de9cb25cfdcfa67dded4"), "503" : "t2q3t", "504" : 12, "505" : 12.1, "506" : 12 } /* 4 */ { "_id" : ObjectId("5ac2de5eb25cfdcfa67ddeaf"), "503" : "abcd", "504" : 13, "505" : 3.6, "506" : 13 } /* 5 */ { "_id" : ObjectId("5ac2de7bb25cfdcfa67ddec3"), "503" : "ttwewqet", "504" : 13, "505" : 0.12, "506" : 13 } /* 6 */ { "_id" : ObjectId("5ac2dea9b25cfdcfa67ddedb"), "503" : "ttwewqet", "504" : 14, "505" : 0.12, "506" : 14 }
result is not correspond to the sort param。But it's right when filed name is characters.
- duplicates
-
MONGOSH-1037 Numeric field are sorted to the front (js shell)
- Closed