@@ -30,41 +30,20 @@ export const MongoDBBlock: BlockConfig<MongoDBResponse | MongoDBIntrospectRespon
3030 ] ,
3131 value : ( ) => 'query' ,
3232 } ,
33- {
34- id : 'connectionMode' ,
35- title : 'Connection Mode' ,
36- type : 'dropdown' ,
37- options : [
38- { label : 'Host & Port' , id : 'host_port' } ,
39- { label : 'Connection String (Atlas)' , id : 'connection_string' } ,
40- ] ,
41- value : ( ) => 'host_port' ,
42- } ,
43- {
44- id : 'connectionString' ,
45- title : 'Connection String' ,
46- type : 'short-input' ,
47- placeholder : 'mongodb+srv://user:password@cluster.mongodb.net/mydb' ,
48- password : true ,
49- condition : { field : 'connectionMode' , value : 'connection_string' } ,
50- required : { field : 'connectionMode' , value : 'connection_string' } ,
51- } ,
5233 {
5334 id : 'host' ,
5435 title : 'Host' ,
5536 type : 'short-input' ,
5637 placeholder : 'localhost or your.mongodb.host' ,
57- condition : { field : 'connectionMode' , value : 'connection_string' , not : true } ,
58- required : { field : 'connectionMode' , value : 'connection_string' , not : true } ,
38+ required : true ,
5939 } ,
6040 {
6141 id : 'port' ,
6242 title : 'Port' ,
6343 type : 'short-input' ,
6444 placeholder : '27017' ,
6545 value : ( ) => '27017' ,
66- condition : { field : 'connectionMode' , value : 'connection_string' , not : true } ,
67- required : { field : 'connectionMode' , value : 'connection_string' , not : true } ,
46+ required : true ,
6847 } ,
6948 {
7049 id : 'database' ,
@@ -78,17 +57,15 @@ export const MongoDBBlock: BlockConfig<MongoDBResponse | MongoDBIntrospectRespon
7857 title : 'Username' ,
7958 type : 'short-input' ,
8059 placeholder : 'mongodb_user' ,
81- condition : { field : 'connectionMode' , value : 'connection_string' , not : true } ,
82- required : { field : 'connectionMode' , value : 'connection_string' , not : true } ,
60+ required : true ,
8361 } ,
8462 {
8563 id : 'password' ,
8664 title : 'Password' ,
8765 type : 'short-input' ,
8866 password : true ,
8967 placeholder : 'Your database password' ,
90- condition : { field : 'connectionMode' , value : 'connection_string' , not : true } ,
91- required : { field : 'connectionMode' , value : 'connection_string' , not : true } ,
68+ required : true ,
9269 } ,
9370 {
9471 id : 'authSource' ,
@@ -860,7 +837,7 @@ Return ONLY the MongoDB query filter as valid JSON - no explanations, no markdow
860837 }
861838 } ,
862839 params : ( params ) => {
863- const { operation, documents, connectionMode , ...rest } = params
840+ const { operation, documents, ...rest } = params
864841
865842 let parsedDocuments
866843 if ( documents && typeof documents === 'string' && documents . trim ( ) ) {
@@ -876,7 +853,7 @@ Return ONLY the MongoDB query filter as valid JSON - no explanations, no markdow
876853 parsedDocuments = documents
877854 }
878855
879- const connectionConfig : Record < string , unknown > = {
856+ const connectionConfig = {
880857 host : rest . host ,
881858 port : typeof rest . port === 'string' ? Number . parseInt ( rest . port , 10 ) : rest . port || 27017 ,
882859 database : rest . database ,
@@ -886,10 +863,6 @@ Return ONLY the MongoDB query filter as valid JSON - no explanations, no markdow
886863 ssl : rest . ssl || 'preferred' ,
887864 }
888865
889- if ( rest . connectionString ) {
890- connectionConfig . connectionString = rest . connectionString
891- }
892-
893866 const result : any = { ...connectionConfig }
894867
895868 if ( rest . collection ) result . collection = rest . collection
@@ -927,8 +900,6 @@ Return ONLY the MongoDB query filter as valid JSON - no explanations, no markdow
927900 } ,
928901 inputs : {
929902 operation : { type : 'string' , description : 'Database operation to perform' } ,
930- connectionMode : { type : 'string' , description : 'Connection mode (host_port or connection_string)' } ,
931- connectionString : { type : 'string' , description : 'Full MongoDB connection string' } ,
932903 host : { type : 'string' , description : 'MongoDB host' } ,
933904 port : { type : 'string' , description : 'MongoDB port' } ,
934905 database : { type : 'string' , description : 'Database name' } ,
0 commit comments