We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af93c8b commit acbc6b1Copy full SHA for acbc6b1
jstests/sort8.js
@@ -0,0 +1,17 @@
1
+// Check sorting of arrays indexed by key SERVER-2884
2
+
3
+if ( 0 ) { // SERVER-2884
4
+t = db.jstests_sort8;
5
+t.drop();
6
7
+t.save( {a:[1,10]} );
8
+t.save( {a:5} );
9
+unindexedForward = t.find().sort( {a:1} ).toArray();
10
+unindexedReverse = t.find().sort( {a:-1} ).toArray();
11
+t.ensureIndex( {a:1} );
12
+indexedForward = t.find().sort( {a:1} ).hint( {a:1} ).toArray();
13
+indexedReverse = t.find().sort( {a:1} ).hint( {a:1} ).toArray();
14
15
+assert.eq( unindexedForward, indexedForward );
16
+assert.eq( unindexedReverse, indexedReverse );
17
+}
0 commit comments