mongodb

package
v0.0.0-...-49b2967 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, host string, userName string, password string) (*mongo.Client, error)

Connect attempts to connect to a mongo db instance.

func CreateCollection

func CreateCollection(ctx context.Context, db *mongo.Database, collectionName string) (*mongo.Collection, error)

CreateCollection will create the specified collection in the specified database if it doesn't already exist.

func CreateVectorIndex

func CreateVectorIndex(ctx context.Context, col *mongo.Collection, vectorIndexName string, settings VectorIndexSettings) error

CreateVectorIndex creates a very specific vector index for our example.

Types

type Index

type Index struct {
	ID   string `bson:"id"`
	Type string `bson:"type"`
}

Index represents information about an index.

type VectorIndexSettings

type VectorIndexSettings struct {
	NumDimensions int
	Path          string
	Similarity    string
}

VectorIndexSettings represents setting to create a vector index.

Jump to

Keyboard shortcuts

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