jstests/concurrency/fsm_workloads/view_catalog_cycle_lookup.js
/**
         * Redefines a view definition by changing 'viewOn' to the underlying collection. This may
         * lead to a failed command if the given collMod would introduce a cycle. We ignore this
         * error as it is expected at view create/modification time.
         */
Redefines a view definition by changing 'viewOn' to the underlying collection. This may
lead to a failed command if the given collMod would introduce a cycle. We ignore this
error as it is expected at view create/modification time.
Redefines a view definition by changing ' viewOn ' to the underlying collection . This may lead to a failed command if the given collMod would introduce a cycle . We ignore this error as it is expected at view create / modification time .
function remapViewToCollection(db, collName) {
            if (this.isShardedAndShardedLookupDisabled || this.isSBELookupEnabled) {
                return;
            }
            const fromName = this.getRandomView(this.viewList);
            const res = db.runCommand(
                {collMod: fromName, viewOn: collName, pipeline: this.getRandomViewPipeline()});
            assertAlways(res.ok === 1 ||
                             [
                                 ErrorCodes.GraphContainsCycle,
                                 ErrorCodes.ConflictingOperationInProgress
                             ].includes(res.code),
                         tojson(res));
        }
function remapViewToCollection ( db , collName ) { if ( this . isShardedAndShardedLookupDisabled || this . isSBELookupEnabled ) { return ; } const fromName = this . getRandomView ( this . viewList ) ; const res = db . runCommand ( { collMod : fromName , viewOn : collName , pipeline : this . getRandomViewPipeline ( ) } ) ; assertAlways ( res . ok === 1 || [ ErrorCodes . GraphContainsCycle , ErrorCodes . ConflictingOperationInProgress ] . includes ( res . code ) , tojson ( res ) ) ; }
Redefines a view definition by changing 'viewOn' to the underlying collection.
Redefines a view definition by changing ' viewOn ' to the underlying collection .