Files
mongo/jstests/aggregation/sources/internal_document_sources.js
Zac 591928c619 SERVER-108478 JS formatted by prettier and remove clang-format (#39656)
GitOrigin-RevId: 6c8f6aded47f260aa4f7c231b17dae3302cb1e04
2025-08-21 17:27:09 +00:00

12 lines
454 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);
}