File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -174,10 +174,15 @@ export class AggregateTool extends MongoDBToolBase {
174174 }
175175
176176 for ( const stage of pipeline ) {
177+ // This validates that in readOnly mode or "write" operations are disabled, we can't use $out or $merge.
178+ // This is really important because aggregates are the only "multi-faceted" tool in the MQL, where you
179+ // can both read and write.
177180 if ( ( stage . $out || stage . $merge ) && writeStageForbiddenError ) {
178181 throw new MongoDBError ( ErrorCodes . ForbiddenWriteOperation , writeStageForbiddenError ) ;
179182 }
180183
184+ // This ensure that you can't use $vectorSearch if the cluster does not support MongoDB Search
185+ // either in Atlas or in a local cluster.
181186 if ( stage . $vectorSearch && ! isSearchSupported ) {
182187 throw new MongoDBError (
183188 ErrorCodes . AtlasSearchNotSupported ,
You can’t perform that action at this time.
0 commit comments