mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-10 07:58:12 -05:00
feat: Make MongoDB filterParams optional (#1614)
Co-authored-by: Averi Kitsch <akitsch@google.com>
This commit is contained in:
@@ -54,4 +54,4 @@ tools:
|
|||||||
| database | string | true | The name of the MongoDB database containing the collection. |
|
| database | string | true | The name of the MongoDB database containing the collection. |
|
||||||
| collection | string | true | The name of the MongoDB collection from which to delete documents. |
|
| collection | string | true | The name of the MongoDB collection from which to delete documents. |
|
||||||
| filterPayload | string | true | The MongoDB query filter document to select the documents for deletion. Uses `{{json .param_name}}` for templating. |
|
| filterPayload | string | true | The MongoDB query filter document to select the documents for deletion. Uses `{{json .param_name}}` for templating. |
|
||||||
| filterParams | list | true | A list of parameter objects that define the variables used in the `filterPayload`. |
|
| filterParams | list | false | A list of parameter objects that define the variables used in the `filterPayload`. |
|
||||||
|
|||||||
@@ -58,4 +58,4 @@ tools:
|
|||||||
| database | string | true | The name of the MongoDB database containing the collection. |
|
| database | string | true | The name of the MongoDB database containing the collection. |
|
||||||
| collection | string | true | The name of the MongoDB collection from which to delete a document. |
|
| collection | string | true | The name of the MongoDB collection from which to delete a document. |
|
||||||
| filterPayload | string | true | The MongoDB query filter document to select the document for deletion. Uses `{{json .param_name}}` for templating. |
|
| filterPayload | string | true | The MongoDB query filter document to select the document for deletion. Uses `{{json .param_name}}` for templating. |
|
||||||
| filterParams | list | true | A list of parameter objects that define the variables used in the `filterPayload`. |
|
| filterParams | list | false | A list of parameter objects that define the variables used in the `filterPayload`. |
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ tools:
|
|||||||
| database | string | true | The name of the MongoDB database to query. |
|
| database | string | true | The name of the MongoDB database to query. |
|
||||||
| collection | string | true | The name of the MongoDB collection to query. |
|
| collection | string | true | The name of the MongoDB collection to query. |
|
||||||
| filterPayload | string | true | The MongoDB query filter document to select the document. Uses `{{json .param_name}}` for templating. |
|
| filterPayload | string | true | The MongoDB query filter document to select the document. Uses `{{json .param_name}}` for templating. |
|
||||||
| filterParams | list | true | A list of parameter objects that define the variables used in the `filterPayload`. |
|
| filterParams | list | false | A list of parameter objects that define the variables used in the `filterPayload`. |
|
||||||
| projectPayload | string | false | An optional MongoDB projection document to specify which fields to include (1) or exclude (0) in the result. |
|
| projectPayload | string | false | An optional MongoDB projection document to specify which fields to include (1) or exclude (0) in the result. |
|
||||||
| projectParams | list | false | A list of parameter objects for the `projectPayload`. |
|
| projectParams | list | false | A list of parameter objects for the `projectPayload`. |
|
||||||
| 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). |
|
| 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). |
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ tools:
|
|||||||
| database | string | true | The name of the MongoDB database to query. |
|
| database | string | true | The name of the MongoDB database to query. |
|
||||||
| collection | string | true | The name of the MongoDB collection to query. |
|
| collection | string | true | The name of the MongoDB collection to query. |
|
||||||
| filterPayload | string | true | The MongoDB query filter document to select which documents to return. Uses `{{json .param_name}}` for templating. |
|
| filterPayload | string | true | The MongoDB query filter document to select which documents to return. Uses `{{json .param_name}}` for templating. |
|
||||||
| filterParams | list | true | A list of parameter objects that define the variables used in the `filterPayload`. |
|
| filterParams | list | false | A list of parameter objects that define the variables used in the `filterPayload`. |
|
||||||
| projectPayload | string | false | An optional MongoDB projection document to specify which fields to include (1) or exclude (0) in the results. |
|
| projectPayload | string | false | An optional MongoDB projection document to specify which fields to include (1) or exclude (0) in the results. |
|
||||||
| projectParams | list | false | A list of parameter objects for the `projectPayload`. |
|
| projectParams | list | false | A list of parameter objects for the `projectPayload`. |
|
||||||
| sortPayload | string | false | An optional MongoDB sort document to define the order of the returned documents. Use 1 for ascending and -1 for descending. |
|
| sortPayload | string | false | An optional MongoDB sort document to define the order of the returned documents. Use 1 for ascending and -1 for descending. |
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ tools:
|
|||||||
| database | string | true | The name of the MongoDB database containing the collection. |
|
| database | string | true | The name of the MongoDB database containing the collection. |
|
||||||
| collection | string | true | The name of the MongoDB collection in which to update documents. |
|
| collection | string | true | The name of the MongoDB collection in which to update documents. |
|
||||||
| 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. |
|
| 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. |
|
||||||
| filterParams | list | true | A list of parameter objects that define the variables used in the `filterPayload`. |
|
| filterParams | list | false | A list of parameter objects that define the variables used in the `filterPayload`. |
|
||||||
| updatePayload | string | true | The MongoDB update document, It's written as a Go template, using `{{json .param_name}}` to insert parameters. |
|
| updatePayload | string | true | The MongoDB update document, It's written as a Go template, using `{{json .param_name}}` to insert parameters. |
|
||||||
| updateParams | list | true | A list of parameter objects that define the variables used in the `updatePayload`. |
|
| updateParams | list | true | A list of parameter objects that define the variables used in the `updatePayload`. |
|
||||||
| 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. |
|
| 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. |
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ tools:
|
|||||||
| database | string | true | The name of the MongoDB database containing the collection. |
|
| database | string | true | The name of the MongoDB database containing the collection. |
|
||||||
| collection | string | true | The name of the MongoDB collection to update a document in. |
|
| collection | string | true | The name of the MongoDB collection to update a document in. |
|
||||||
| 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. |
|
| 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. |
|
||||||
| filterParams | list | true | A list of parameter objects that define the variables used in the `filterPayload`. |
|
| filterParams | list | false | A list of parameter objects that define the variables used in the `filterPayload`. |
|
||||||
| 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. |
|
| 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. |
|
||||||
| updateParams | list | true | A list of parameter objects that define the variables used in the `updatePayload`. |
|
| updateParams | list | true | A list of parameter objects that define the variables used in the `updatePayload`. |
|
||||||
| 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`). |
|
| 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`). |
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ type Config struct {
|
|||||||
Database string `yaml:"database" validate:"required"`
|
Database string `yaml:"database" validate:"required"`
|
||||||
Collection string `yaml:"collection" validate:"required"`
|
Collection string `yaml:"collection" validate:"required"`
|
||||||
FilterPayload string `yaml:"filterPayload" validate:"required"`
|
FilterPayload string `yaml:"filterPayload" validate:"required"`
|
||||||
FilterParams tools.Parameters `yaml:"filterParams" validate:"required"`
|
FilterParams tools.Parameters `yaml:"filterParams"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate interface
|
// validate interface
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ type Config struct {
|
|||||||
Database string `yaml:"database" validate:"required"`
|
Database string `yaml:"database" validate:"required"`
|
||||||
Collection string `yaml:"collection" validate:"required"`
|
Collection string `yaml:"collection" validate:"required"`
|
||||||
FilterPayload string `yaml:"filterPayload" validate:"required"`
|
FilterPayload string `yaml:"filterPayload" validate:"required"`
|
||||||
FilterParams tools.Parameters `yaml:"filterParams" validate:"required"`
|
FilterParams tools.Parameters `yaml:"filterParams"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate interface
|
// validate interface
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ type Config struct {
|
|||||||
Database string `yaml:"database" validate:"required"`
|
Database string `yaml:"database" validate:"required"`
|
||||||
Collection string `yaml:"collection" validate:"required"`
|
Collection string `yaml:"collection" validate:"required"`
|
||||||
FilterPayload string `yaml:"filterPayload" validate:"required"`
|
FilterPayload string `yaml:"filterPayload" validate:"required"`
|
||||||
FilterParams tools.Parameters `yaml:"filterParams" validate:"required"`
|
FilterParams tools.Parameters `yaml:"filterParams"`
|
||||||
ProjectPayload string `yaml:"projectPayload"`
|
ProjectPayload string `yaml:"projectPayload"`
|
||||||
ProjectParams tools.Parameters `yaml:"projectParams"`
|
ProjectParams tools.Parameters `yaml:"projectParams"`
|
||||||
SortPayload string `yaml:"sortPayload"`
|
SortPayload string `yaml:"sortPayload"`
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ type Config struct {
|
|||||||
Database string `yaml:"database" validate:"required"`
|
Database string `yaml:"database" validate:"required"`
|
||||||
Collection string `yaml:"collection" validate:"required"`
|
Collection string `yaml:"collection" validate:"required"`
|
||||||
FilterPayload string `yaml:"filterPayload" validate:"required"`
|
FilterPayload string `yaml:"filterPayload" validate:"required"`
|
||||||
FilterParams tools.Parameters `yaml:"filterParams" validate:"required"`
|
FilterParams tools.Parameters `yaml:"filterParams"`
|
||||||
UpdatePayload string `yaml:"updatePayload" validate:"required"`
|
UpdatePayload string `yaml:"updatePayload" validate:"required"`
|
||||||
UpdateParams tools.Parameters `yaml:"updateParams" validate:"required"`
|
UpdateParams tools.Parameters `yaml:"updateParams" validate:"required"`
|
||||||
Canonical bool `yaml:"canonical" validate:"required"`
|
Canonical bool `yaml:"canonical" validate:"required"`
|
||||||
@@ -127,7 +127,7 @@ type Tool struct {
|
|||||||
Description string `yaml:"description"`
|
Description string `yaml:"description"`
|
||||||
Collection string `yaml:"collection"`
|
Collection string `yaml:"collection"`
|
||||||
FilterPayload string `yaml:"filterPayload" validate:"required"`
|
FilterPayload string `yaml:"filterPayload" validate:"required"`
|
||||||
FilterParams tools.Parameters `yaml:"filterParams" validate:"required"`
|
FilterParams tools.Parameters `yaml:"filterParams"`
|
||||||
UpdatePayload string `yaml:"updatePayload" validate:"required"`
|
UpdatePayload string `yaml:"updatePayload" validate:"required"`
|
||||||
UpdateParams tools.Parameters `yaml:"updateParams" validate:"required"`
|
UpdateParams tools.Parameters `yaml:"updateParams" validate:"required"`
|
||||||
AllParams tools.Parameters `yaml:"allParams"`
|
AllParams tools.Parameters `yaml:"allParams"`
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ type Config struct {
|
|||||||
Database string `yaml:"database" validate:"required"`
|
Database string `yaml:"database" validate:"required"`
|
||||||
Collection string `yaml:"collection" validate:"required"`
|
Collection string `yaml:"collection" validate:"required"`
|
||||||
FilterPayload string `yaml:"filterPayload" validate:"required"`
|
FilterPayload string `yaml:"filterPayload" validate:"required"`
|
||||||
FilterParams tools.Parameters `yaml:"filterParams" validate:"required"`
|
FilterParams tools.Parameters `yaml:"filterParams"`
|
||||||
UpdatePayload string `yaml:"updatePayload" validate:"required"`
|
UpdatePayload string `yaml:"updatePayload" validate:"required"`
|
||||||
UpdateParams tools.Parameters `yaml:"updateParams" validate:"required"`
|
UpdateParams tools.Parameters `yaml:"updateParams" validate:"required"`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user