blob: a88759b0b6597876e993f0327a9ff089de6dcb0c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
// Test that a rename that overwrites its destination with an equivalent value of a different type
// updates the type of the destination (SERVER-32109).
(function() {
"use strict";
let coll = db.rename_change_target_type;
coll.drop();
assert.commandWorked(coll.insert({to: NumberLong(100), from: 100}));
assert.commandWorked(coll.update({}, {$rename: {from: "to"}}));
let aggResult = coll.aggregate([{$project: {toType: {$type: "$to"}}}]).toArray();
assert.eq(aggResult.length, 1);
assert.eq(aggResult[0].toType, "double", "Incorrect type resulting from $rename");
})();
|