File tree 2 files changed +12
-2
lines changed
templates/components/vectordbs/typescript/mongo 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,12 @@ async function loadAndIndex() {
27
27
dbName : databaseName ,
28
28
collectionName : vectorCollectionName , // this is where your embeddings will be stored
29
29
indexName : indexName , // this is the name of the index you will need to create
30
- populatedMetadataFields : POPULATED_METADATA_FIELDS ,
30
+ indexedMetadataFields : POPULATED_METADATA_FIELDS ,
31
+ embeddingDefinition : {
32
+ dimensions : process . env . EMBEDDING_DIM
33
+ ? parseInt ( process . env . EMBEDDING_DIM )
34
+ : 1536 ,
35
+ } ,
31
36
} ) ;
32
37
33
38
// now create an index from all the Documents and store them in Atlas
Original file line number Diff line number Diff line change @@ -12,7 +12,12 @@ export async function getDataSource(params?: any) {
12
12
dbName : process . env . MONGODB_DATABASE ! ,
13
13
collectionName : process . env . MONGODB_VECTORS ! ,
14
14
indexName : process . env . MONGODB_VECTOR_INDEX ,
15
- populatedMetadataFields : POPULATED_METADATA_FIELDS ,
15
+ indexedMetadataFields : POPULATED_METADATA_FIELDS ,
16
+ embeddingDefinition : {
17
+ dimensions : process . env . EMBEDDING_DIM
18
+ ? parseInt ( process . env . EMBEDDING_DIM )
19
+ : 1536 ,
20
+ } ,
16
21
} ) ;
17
22
18
23
return await VectorStoreIndex . fromVectorStore ( store ) ;
You can’t perform that action at this time.
0 commit comments