mongodbatlas

package
v0.1.314 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

README

MongoDB Atlas Vector Store Construct Library

---

All classes are under active development and subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


Language Package
Typescript Logo TypeScript @cdklabs/generative-ai-cdk-constructs
Python Logo Python cdklabs.generative_ai_cdk_constructs
Java Logo Java io.github.cdklabs.generative_ai_cdk_constructs
.Net .Net CdkLabs.GenerativeAICdkConstructs
Go Go github.com/cdklabs/generative-ai-cdk-constructs-go/generative-ai-cdk-constructs

MongoDBAtlasVectorStore

The MongoDBAtlasVectorStore construct allows you to define a MongoDB Atlas instance as a vector store for your Amazon Bedrock Knowledge Base.

Usage
vectorStore := mongodbAtlas.NewMongoDBAtlasVectorStore(&MongoDBAtlasVectorStoreProps{
	CollectionName: jsii.String("embeddings"),
	CredentialsSecretArn: jsii.String("arn:aws:secretsmanager:region:account:secret:secret-name"),
	DatabaseName: jsii.String("vectordb"),
	Endpoint: jsii.String("https://your-mongodb-atlas-endpoint.mongodb.net"),
	EndpointServiceName: jsii.String("mongodb-atlas"),
	FieldMapping: &MongoDbAtlasFieldMapping{
		VectorField: jsii.String("embedding"),
		TextField: jsii.String("text"),
		MetadataField: jsii.String("metadata"),
	},
	VectorIndexName: jsii.String("vector_index"),
})
Properties

The MongoDBAtlasVectorStore construct accepts the following properties:

Property Type Description
collectionName string The name of the collection in MongoDB Atlas
credentialsSecretArn string The ARN of the AWS Secrets Manager secret containing MongoDB Atlas credentials
databaseName string The name of the database in MongoDB Atlas
endpoint string The endpoint URL for MongoDB Atlas
endpointServiceName string The name of the endpoint service
fieldMapping MongoDbAtlasFieldMapping The mapping of fields in the MongoDB collection
vectorIndexName string The name of the vector index in MongoDB Atlas
Field Mapping

The fieldMapping property defines how fields in your MongoDB collection map to vector store concepts:

Property Type Description
vectorField string The field name for storing vector embeddings
textField string The field name for storing the original text
metadataField string The field name for storing additional metadata

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMongoDBAtlasVectorStore_Override

func NewMongoDBAtlasVectorStore_Override(m MongoDBAtlasVectorStore, props *MongoDBAtlasVectorStoreProps)

Creates a new instance of the MongoDBAtlas class. Experimental.

Types

type MongoDBAtlasVectorStore

type MongoDBAtlasVectorStore interface {
	// The name of the collection.
	// Experimental.
	CollectionName() *string
	// The ARN of the secret containing MongoDB Atlas credentials.
	// Experimental.
	CredentialsSecretArn() *string
	// The name of the database.
	// Experimental.
	DatabaseName() *string
	// The endpoint URL for MongoDB Atlas.
	// Experimental.
	Endpoint() *string
	// The name of the endpoint service.
	// Experimental.
	EndpointServiceName() *string
	// The field mapping for MongoDB Atlas.
	// Experimental.
	FieldMapping() *MongoDbAtlasFieldMapping
	// The name of the text index.
	// Experimental.
	TextIndexName() *string
	// The name of the vector index.
	// Experimental.
	VectorIndexName() *string
}

Construct for MongoDB Atlas vector store. Experimental.

func NewMongoDBAtlasVectorStore

func NewMongoDBAtlasVectorStore(props *MongoDBAtlasVectorStoreProps) MongoDBAtlasVectorStore

Creates a new instance of the MongoDBAtlas class. Experimental.

type MongoDBAtlasVectorStoreProps

type MongoDBAtlasVectorStoreProps struct {
	// The name of the collection.
	// Experimental.
	CollectionName *string `field:"required" json:"collectionName" yaml:"collectionName"`
	// The ARN of the secret containing MongoDB Atlas credentials.
	// Experimental.
	CredentialsSecretArn *string `field:"required" json:"credentialsSecretArn" yaml:"credentialsSecretArn"`
	// The name of the database.
	// Experimental.
	DatabaseName *string `field:"required" json:"databaseName" yaml:"databaseName"`
	// The endpoint URL for MongoDB Atlas.
	// Experimental.
	Endpoint *string `field:"required" json:"endpoint" yaml:"endpoint"`
	// The field mapping for MongoDB Atlas.
	// Experimental.
	FieldMapping *MongoDbAtlasFieldMapping `field:"required" json:"fieldMapping" yaml:"fieldMapping"`
	// The name of the vector index.
	// Experimental.
	VectorIndexName *string `field:"required" json:"vectorIndexName" yaml:"vectorIndexName"`
	// The name of the endpoint service.
	// Experimental.
	EndpointServiceName *string `field:"optional" json:"endpointServiceName" yaml:"endpointServiceName"`
	// The name of the text index.
	// Experimental.
	TextIndexName *string `field:"optional" json:"textIndexName" yaml:"textIndexName"`
}

Interface for MongoDB Atlas vector store configuration. Experimental.

type MongoDbAtlasFieldMapping

type MongoDbAtlasFieldMapping struct {
	// The field name for the metadata field.
	// Experimental.
	MetadataField *string `field:"required" json:"metadataField" yaml:"metadataField"`
	// The field name for the text field.
	// Experimental.
	TextField *string `field:"required" json:"textField" yaml:"textField"`
	// The field name for the vector field.
	// Experimental.
	VectorField *string `field:"required" json:"vectorField" yaml:"vectorField"`
}

Interface for MongoDB Atlas field mapping. Experimental.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL