Skip to content

Commit 208ab92

Browse files
feat: Make MongoDB filterParams optional (googleapis#1614)
Co-authored-by: Averi Kitsch <[email protected]>
1 parent e8c7fe0 commit 208ab92

File tree

11 files changed

+12
-12
lines changed

11 files changed

+12
-12
lines changed

docs/en/resources/tools/mongodb/mongodb-delete-many.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ tools:
5454
| database | string | true | The name of the MongoDB database containing the collection. |
5555
| collection | string | true | The name of the MongoDB collection from which to delete documents. |
5656
| filterPayload | string | true | The MongoDB query filter document to select the documents for deletion. Uses `{{json .param_name}}` for templating. |
57-
| filterParams | list | true | A list of parameter objects that define the variables used in the `filterPayload`. |
57+
| filterParams | list | false | A list of parameter objects that define the variables used in the `filterPayload`. |

docs/en/resources/tools/mongodb/mongodb-delete-one.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ tools:
5858
| database | string | true | The name of the MongoDB database containing the collection. |
5959
| collection | string | true | The name of the MongoDB collection from which to delete a document. |
6060
| filterPayload | string | true | The MongoDB query filter document to select the document for deletion. Uses `{{json .param_name}}` for templating. |
61-
| filterParams | list | true | A list of parameter objects that define the variables used in the `filterPayload`. |
61+
| filterParams | list | false | A list of parameter objects that define the variables used in the `filterPayload`. |

docs/en/resources/tools/mongodb/mongodb-find-one.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ tools:
6161
| database | string | true | The name of the MongoDB database to query. |
6262
| collection | string | true | The name of the MongoDB collection to query. |
6363
| filterPayload | string | true | The MongoDB query filter document to select the document. Uses `{{json .param_name}}` for templating. |
64-
| filterParams | list | true | A list of parameter objects that define the variables used in the `filterPayload`. |
64+
| filterParams | list | false | A list of parameter objects that define the variables used in the `filterPayload`. |
6565
| projectPayload | string | false | An optional MongoDB projection document to specify which fields to include (1) or exclude (0) in the result. |
6666
| projectParams | list | false | A list of parameter objects for the `projectPayload`. |
6767
| sortPayload | string | false | An optional MongoDB sort document. Useful for selecting which document to return if the filter matches multiple (e.g., get the most recent). |

docs/en/resources/tools/mongodb/mongodb-find.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ tools:
6868
| database | string | true | The name of the MongoDB database to query. |
6969
| collection | string | true | The name of the MongoDB collection to query. |
7070
| filterPayload | string | true | The MongoDB query filter document to select which documents to return. Uses `{{json .param_name}}` for templating. |
71-
| filterParams | list | true | A list of parameter objects that define the variables used in the `filterPayload`. |
71+
| filterParams | list | false | A list of parameter objects that define the variables used in the `filterPayload`. |
7272
| projectPayload | string | false | An optional MongoDB projection document to specify which fields to include (1) or exclude (0) in the results. |
7373
| projectParams | list | false | A list of parameter objects for the `projectPayload`. |
7474
| sortPayload | string | false | An optional MongoDB sort document to define the order of the returned documents. Use 1 for ascending and -1 for descending. |

docs/en/resources/tools/mongodb/mongodb-update-many.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ tools:
6565
| database | string | true | The name of the MongoDB database containing the collection. |
6666
| collection | string | true | The name of the MongoDB collection in which to update documents. |
6767
| filterPayload | string | true | The MongoDB query filter document to select the documents for updating. It's written as a Go template, using `{{json .param_name}}` to insert parameters. |
68-
| filterParams | list | true | A list of parameter objects that define the variables used in the `filterPayload`. |
68+
| filterParams | list | false | A list of parameter objects that define the variables used in the `filterPayload`. |
6969
| updatePayload | string | true | The MongoDB update document, It's written as a Go template, using `{{json .param_name}}` to insert parameters. |
7070
| updateParams | list | true | A list of parameter objects that define the variables used in the `updatePayload`. |
7171
| canonical | bool | true | Determines if the `filterPayload` and `updatePayload` strings are parsed using MongoDB's Canonical or Relaxed Extended JSON format. **Canonical** is stricter about type representation, while **Relaxed** is more lenient. |

docs/en/resources/tools/mongodb/mongodb-update-one.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ tools:
6565
| database | string | true | The name of the MongoDB database containing the collection. |
6666
| collection | string | true | The name of the MongoDB collection to update a document in. |
6767
| filterPayload | string | true | The MongoDB query filter document to select the document for updating. It's written as a Go template, using `{{json .param_name}}` to insert parameters. |
68-
| filterParams | list | true | A list of parameter objects that define the variables used in the `filterPayload`. |
68+
| filterParams | list | false | A list of parameter objects that define the variables used in the `filterPayload`. |
6969
| updatePayload | string | true | The MongoDB update document, which specifies the modifications. This often uses update operators like `$set`. It's written as a Go template, using `{{json .param_name}}` to insert parameters. |
7070
| updateParams | list | true | A list of parameter objects that define the variables used in the `updatePayload`. |
7171
| canonical | bool | true | Determines if the `updatePayload` string is parsed using MongoDB's Canonical or Relaxed Extended JSON format. **Canonical** is stricter about type representation (e.g., `{"$numberInt": "42"}`), while **Relaxed** is more lenient (e.g., `42`). |

internal/tools/mongodb/mongodbdeletemany/mongodbdeletemany.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type Config struct {
5454
Database string `yaml:"database" validate:"required"`
5555
Collection string `yaml:"collection" validate:"required"`
5656
FilterPayload string `yaml:"filterPayload" validate:"required"`
57-
FilterParams tools.Parameters `yaml:"filterParams" validate:"required"`
57+
FilterParams tools.Parameters `yaml:"filterParams"`
5858
}
5959

6060
// validate interface

internal/tools/mongodb/mongodbdeleteone/mongodbdeleteone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type Config struct {
5353
Database string `yaml:"database" validate:"required"`
5454
Collection string `yaml:"collection" validate:"required"`
5555
FilterPayload string `yaml:"filterPayload" validate:"required"`
56-
FilterParams tools.Parameters `yaml:"filterParams" validate:"required"`
56+
FilterParams tools.Parameters `yaml:"filterParams"`
5757
}
5858

5959
// validate interface

internal/tools/mongodb/mongodbfindone/mongodbfindone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type Config struct {
5454
Database string `yaml:"database" validate:"required"`
5555
Collection string `yaml:"collection" validate:"required"`
5656
FilterPayload string `yaml:"filterPayload" validate:"required"`
57-
FilterParams tools.Parameters `yaml:"filterParams" validate:"required"`
57+
FilterParams tools.Parameters `yaml:"filterParams"`
5858
ProjectPayload string `yaml:"projectPayload"`
5959
ProjectParams tools.Parameters `yaml:"projectParams"`
6060
SortPayload string `yaml:"sortPayload"`

internal/tools/mongodb/mongodbupdatemany/mongodbupdatemany.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type Config struct {
5252
Database string `yaml:"database" validate:"required"`
5353
Collection string `yaml:"collection" validate:"required"`
5454
FilterPayload string `yaml:"filterPayload" validate:"required"`
55-
FilterParams tools.Parameters `yaml:"filterParams" validate:"required"`
55+
FilterParams tools.Parameters `yaml:"filterParams"`
5656
UpdatePayload string `yaml:"updatePayload" validate:"required"`
5757
UpdateParams tools.Parameters `yaml:"updateParams" validate:"required"`
5858
Canonical bool `yaml:"canonical" validate:"required"`
@@ -127,7 +127,7 @@ type Tool struct {
127127
Description string `yaml:"description"`
128128
Collection string `yaml:"collection"`
129129
FilterPayload string `yaml:"filterPayload" validate:"required"`
130-
FilterParams tools.Parameters `yaml:"filterParams" validate:"required"`
130+
FilterParams tools.Parameters `yaml:"filterParams"`
131131
UpdatePayload string `yaml:"updatePayload" validate:"required"`
132132
UpdateParams tools.Parameters `yaml:"updateParams" validate:"required"`
133133
AllParams tools.Parameters `yaml:"allParams"`

0 commit comments

Comments
 (0)