Files
mongo/jstests/aggregation/sources/internal_document_sources.js
Mihai Andrei 1a8480a015 SERVER-95514 Assign more narrow ownership to files under 'jstests/aggregation' (#30660)
GitOrigin-RevId: 494c0fdfadd2f8986333dbf4242462d576439c4b
2025-01-22 20:14:44 +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);
}