Class MongoPlugin.Builder
java.lang.Object
com.google.genkit.plugins.mongodb.MongoPlugin.Builder
- Enclosing class:
MongoPlugin
Builder for
MongoPlugin.-
Method Summary
Modifier and TypeMethodDescriptionaddCollection(MongoVectorStoreConfig config) Adds a collection configuration.build()Builds the plugin.client(com.mongodb.client.MongoClient client) Sets an external MongoDB client to use instead of creating one from a connection string.connectionString(String connectionString) Sets the MongoDB connection string (required unless an external client is provided).
-
Method Details
-
connectionString
Sets the MongoDB connection string (required unless an external client is provided).- Parameters:
connectionString- the connection string- Returns:
- this builder
-
client
Sets an external MongoDB client to use instead of creating one from a connection string.- Parameters:
client- the client- Returns:
- this builder
-
addCollection
Adds a collection configuration.- Parameters:
config- the collection configuration- Returns:
- this builder
-
build
Builds the plugin.- Returns:
- a new
MongoPlugin
-