Skip to content

Commit acbc6b1

Browse files
committed
SERVER-2884 test
1 parent af93c8b commit acbc6b1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

jstests/sort8.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)