Files
mongo/jstests/aggregation/internal_document_sources.js
Ben Shteinfeld 61532a03f3 SERVER-95731 Remove unused DocumentSource parser registrations (#28474)
GitOrigin-RevId: b2955cf8e08282912b02d6279615742d6c921915
2024-10-25 13:05:34 +00:00

15 lines
465 B
JavaScript

// This is intended to reproduce SERVER-95731. The $_internal* document sources are not intended to
// be user-facing. This test verifies use using internal document sources fails.
const coll = db.internal_document_source;
assert.commandWorked(coll.insert({a: 1}));
const pipelines = [
[{$_internalReplaceRoot: {}}],
[{$_internalProjection: {}}],
];
for (const pipeline of pipelines) {
assert.throwsWithCode(() => coll.aggregate(pipeline), 40324);
}