{"record":{"id":"49e88382fdb1983e","repo":"googleapis/mcp-toolbox","slug":"this-is-not-a-read-only-pipeline-v","errorCode":null,"errorMessage":"this is not a read-only pipeline: %+v","messagePattern":"this is not a read-only pipeline: %\\+v","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/mongodb/mongodb.go","lineNumber":135,"sourceCode":"\t\t}\n\t\tfinal = append(final, tmp2)\n\t}\n\treturn final, err\n}\n\nfunc (s *Source) Aggregate(ctx context.Context, pipelineString string, canonical, readOnly bool, database, collection string) ([]any, error) {\n\tvar pipeline = []bson.M{}\n\terr := bson.UnmarshalExtJSON([]byte(pipelineString), canonical, &pipeline)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif readOnly {\n\t\t//fail if we do a merge or an out\n\t\tfor _, stage := range pipeline {\n\t\t\tfor key := range stage {\n\t\t\t\tif key == \"$merge\" || key == \"$out\" {\n\t\t\t\t\treturn nil, fmt.Errorf(\"this is not a read-only pipeline: %+v\", stage)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tcur, err := s.MongoClient().Database(database).Collection(collection).Aggregate(ctx, pipeline)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer cur.Close(ctx)\n\tres, err := parseData(ctx, cur)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif res == nil {\n\t\treturn []any{}, nil\n\t}\n\treturn res, err","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/mongodb/mongodb.go#L117-L153","documentation":"Error \"this is not a read-only pipeline: %+v\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/mongodb/mongodb.go:135 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}