Files
mongo/jstests/core/sorta.js
Kyle Suarez 92d366961e SERVER-30384 unblacklist tests from causally consistent jscore passthroughs
Refactors more tests that should be allowed to run in the causally
consistent passthroughs.
2017-11-28 11:51:15 -05:00

31 lines
728 B
JavaScript

// SERVER-2905 sorting with missing fields
(function() {
'use strict';
var coll = db.jstests_sorta;
coll.drop();
const docs = [
{_id: 0, a: MinKey},
{_id: 1, a: []},
{_id: 2, a: []},
{_id: 3, a: null},
{_id: 4},
{_id: 5, a: null},
{_id: 6, a: 1},
{_id: 7, a: [2]},
{_id: 8, a: MaxKey}
];
const bulk = coll.initializeUnorderedBulkOp();
for (let doc of docs) {
bulk.insert(doc);
}
assert.writeOK(bulk.execute());
assert.eq(coll.find().sort({a: 1, _id: 1}).toArray(), docs);
assert.commandWorked(coll.createIndex({a: 1, _id: 1}));
assert.eq(coll.find().sort({a: 1, _id: 1}).toArray(), docs);
})();