From 339c730585199165cea9469baf2ed38f2c9bd4a0 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 17 Aug 2026 10:29:26 +0000
Subject: [PATCH 1/7] Rename CosmosMongoDB to CosmosDocumentDB
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
---
.github/workflows/mevd.yml | 4 +-
CommunityToolkit.AI.slnx | 6 +-
MEVD/MEVD.slnf | 6 +-
.../AssemblyInfo.cs | 0
.../CosmosDocumentDB.csproj} | 8 +-
.../CosmosDocumentDBCollection.cs} | 52 +++----
...osmosDocumentDBCollectionCreateMapping.cs} | 18 +--
.../CosmosDocumentDBCollectionOptions.cs} | 14 +-
...osmosDocumentDBCollectionSearchMapping.cs} | 8 +-
.../CosmosDocumentDBConstants.cs} | 4 +-
.../CosmosDocumentDBDynamicCollection.cs} | 8 +-
.../CosmosDocumentDBFilterTranslator.cs} | 4 +-
...sDocumentDBServiceCollectionExtensions.cs} | 142 +++++++++---------
.../CosmosDocumentDBVectorStore.cs} | 24 +--
.../CosmosDocumentDBVectorStoreOptions.cs} | 12 +-
.../MongoShared/BsonValueFactory.cs | 2 +-
.../MongoShared/ErrorHandlingAsyncCursor.cs | 2 +-
.../MongoShared/IMongoMapper.cs | 2 +-
.../MongoShared/MongoConstants.cs | 2 +-
.../MongoShared/MongoDynamicMapper.cs | 2 +-
.../MongoShared/MongoMapper.cs | 2 +-
.../MongoShared/MongoModelBuilder.cs | 2 +-
.../MongoShared/README.md | 2 +-
.../README.md | 4 +-
.../CosmosDocumentDB.ConformanceTests.csproj} | 4 +-
.../CosmosDocumentDBBsonMappingTests.cs} | 24 +--
...mosDocumentDBCollectionManagementTests.cs} | 8 +-
...smosDocumentDBDependencyInjectionTests.cs} | 72 ++++-----
.../CosmosDocumentDBDistanceFunctionTests.cs} | 12 +-
...smosDocumentDBEmbeddingGenerationTests.cs} | 32 ++--
.../CosmosDocumentDBFilterTests.cs} | 12 +-
.../CosmosDocumentDBIndexKindTests.cs} | 10 +-
...DocumentDBTestSuiteImplementationTests.cs} | 4 +-
.../CosmosDocumentDBBasicModelTests.cs | 18 +++
.../CosmosDocumentDBMultiVectorModelTests.cs} | 10 +-
.../CosmosDocumentDBNoDataModelTests.cs | 18 +++
.../CosmosDocumentDBNoVectorModelTests.cs | 18 +++
.../Properties/AssemblyAttributes.cs | 0
.../Support/CosmosDocumentDBFixture.cs} | 6 +-
.../CosmosDocumentDBTestEnvironment.cs} | 10 +-
.../Support/CosmosDocumentDBTestStore.cs} | 20 +--
.../CosmosDocumentDBDataTypeTests.cs} | 10 +-
.../CosmosDocumentDBEmbeddingTypeTests.cs} | 10 +-
.../CosmosDocumentDBKeyTypeTests.cs} | 10 +-
.../.editorconfig | 0
.../CosmosDocumentDB.UnitTests.csproj} | 6 +-
.../CosmosDocumentDBCollectionTests.cs} | 56 +++----
.../CosmosDocumentDBHotelModel.cs} | 4 +-
.../CosmosDocumentDBVectorStoreTests.cs} | 18 +--
.../ModelTests/CosmosMongoBasicModelTests.cs | 18 ---
.../ModelTests/CosmosMongoNoDataModelTests.cs | 18 ---
.../CosmosMongoNoVectorModelTests.cs | 18 ---
README.md | 10 +-
53 files changed, 393 insertions(+), 393 deletions(-)
rename MEVD/src/{CosmosMongoDB => CosmosDocumentDB}/AssemblyInfo.cs (100%)
rename MEVD/src/{CosmosMongoDB/CosmosMongoDB.csproj => CosmosDocumentDB/CosmosDocumentDB.csproj} (71%)
rename MEVD/src/{CosmosMongoDB/CosmosMongoCollection.cs => CosmosDocumentDB/CosmosDocumentDBCollection.cs} (92%)
rename MEVD/src/{CosmosMongoDB/CosmosMongoCollectionCreateMapping.cs => CosmosDocumentDB/CosmosDocumentDBCollectionCreateMapping.cs} (84%)
rename MEVD/src/{CosmosMongoDB/CosmosMongoCollectionOptions.cs => CosmosDocumentDB/CosmosDocumentDBCollectionOptions.cs} (74%)
rename MEVD/src/{CosmosMongoDB/CosmosMongoCollectionSearchMapping.cs => CosmosDocumentDB/CosmosDocumentDBCollectionSearchMapping.cs} (94%)
rename MEVD/src/{CosmosMongoDB/CosmosMongoConstants.cs => CosmosDocumentDB/CosmosDocumentDBConstants.cs} (67%)
rename MEVD/src/{CosmosMongoDB/CosmosMongoDynamicCollection.cs => CosmosDocumentDB/CosmosDocumentDBDynamicCollection.cs} (74%)
rename MEVD/src/{CosmosMongoDB/CosmosMongoFilterTranslator.cs => CosmosDocumentDB/CosmosDocumentDBFilterTranslator.cs} (98%)
rename MEVD/src/{CosmosMongoDB/CosmosMongoServiceCollectionExtensions.cs => CosmosDocumentDB/CosmosDocumentDBServiceCollectionExtensions.cs} (63%)
rename MEVD/src/{CosmosMongoDB/CosmosMongoVectorStore.cs => CosmosDocumentDB/CosmosDocumentDBVectorStore.cs} (82%)
rename MEVD/src/{CosmosMongoDB/CosmosMongoVectorStoreOptions.cs => CosmosDocumentDB/CosmosDocumentDBVectorStoreOptions.cs} (56%)
rename MEVD/src/{CosmosMongoDB => CosmosDocumentDB}/MongoShared/BsonValueFactory.cs (95%)
rename MEVD/src/{CosmosMongoDB => CosmosDocumentDB}/MongoShared/ErrorHandlingAsyncCursor.cs (97%)
rename MEVD/src/{CosmosMongoDB => CosmosDocumentDB}/MongoShared/IMongoMapper.cs (92%)
rename MEVD/src/{CosmosMongoDB => CosmosDocumentDB}/MongoShared/MongoConstants.cs (97%)
rename MEVD/src/{CosmosMongoDB => CosmosDocumentDB}/MongoShared/MongoDynamicMapper.cs (99%)
rename MEVD/src/{CosmosMongoDB => CosmosDocumentDB}/MongoShared/MongoMapper.cs (99%)
rename MEVD/src/{CosmosMongoDB => CosmosDocumentDB}/MongoShared/MongoModelBuilder.cs (98%)
rename MEVD/src/{CosmosMongoDB => CosmosDocumentDB}/MongoShared/README.md (77%)
rename MEVD/src/{CosmosMongoDB => CosmosDocumentDB}/README.md (86%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/CosmosMongoDB.ConformanceTests.csproj => CosmosDocumentDB.ConformanceTests/CosmosDocumentDB.ConformanceTests.csproj} (88%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/CosmosMongoBsonMappingTests.cs => CosmosDocumentDB.ConformanceTests/CosmosDocumentDBBsonMappingTests.cs} (79%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/CosmosMongoCollectionManagementTests.cs => CosmosDocumentDB.ConformanceTests/CosmosDocumentDBCollectionManagementTests.cs} (55%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/CosmosMongoDependencyInjectionTests.cs => CosmosDocumentDB.ConformanceTests/CosmosDocumentDBDependencyInjectionTests.cs} (73%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/CosmosMongoDistanceFunctionTests.cs => CosmosDocumentDB.ConformanceTests/CosmosDocumentDBDistanceFunctionTests.cs} (71%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/CosmosMongoEmbeddingGenerationTests.cs => CosmosDocumentDB.ConformanceTests/CosmosDocumentDBEmbeddingGenerationTests.cs} (51%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/CosmosMongoFilterTests.cs => CosmosDocumentDB.ConformanceTests/CosmosDocumentDBFilterTests.cs} (89%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/CosmosMongoIndexKindTests.cs => CosmosDocumentDB.ConformanceTests/CosmosDocumentDBIndexKindTests.cs} (67%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/CosmosMongoTestSuiteImplementationTests.cs => CosmosDocumentDB.ConformanceTests/CosmosDocumentDBTestSuiteImplementationTests.cs} (75%)
create mode 100644 MEVD/test/CosmosDocumentDB.ConformanceTests/ModelTests/CosmosDocumentDBBasicModelTests.cs
rename MEVD/test/{CosmosMongoDB.ConformanceTests/ModelTests/CosmosMongoMultiVectorModelTests.cs => CosmosDocumentDB.ConformanceTests/ModelTests/CosmosDocumentDBMultiVectorModelTests.cs} (53%)
create mode 100644 MEVD/test/CosmosDocumentDB.ConformanceTests/ModelTests/CosmosDocumentDBNoDataModelTests.cs
create mode 100644 MEVD/test/CosmosDocumentDB.ConformanceTests/ModelTests/CosmosDocumentDBNoVectorModelTests.cs
rename MEVD/test/{CosmosMongoDB.ConformanceTests => CosmosDocumentDB.ConformanceTests}/Properties/AssemblyAttributes.cs (100%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/Support/CosmosMongoFixture.cs => CosmosDocumentDB.ConformanceTests/Support/CosmosDocumentDBFixture.cs} (50%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/Support/CosmosMongoTestEnvironment.cs => CosmosDocumentDB.ConformanceTests/Support/CosmosDocumentDBTestEnvironment.cs} (70%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/Support/CosmosMongoTestStore.cs => CosmosDocumentDB.ConformanceTests/Support/CosmosDocumentDBTestStore.cs} (60%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/TypeTests/CosmosMongoDataTypeTests.cs => CosmosDocumentDB.ConformanceTests/TypeTests/CosmosDocumentDBDataTypeTests.cs} (86%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/TypeTests/CosmosMongoEmbeddingTypeTests.cs => CosmosDocumentDB.ConformanceTests/TypeTests/CosmosDocumentDBEmbeddingTypeTests.cs} (50%)
rename MEVD/test/{CosmosMongoDB.ConformanceTests/TypeTests/CosmosMongoKeyTypeTests.cs => CosmosDocumentDB.ConformanceTests/TypeTests/CosmosDocumentDBKeyTypeTests.cs} (65%)
rename MEVD/test/{CosmosMongoDB.UnitTests => CosmosDocumentDB.UnitTests}/.editorconfig (100%)
rename MEVD/test/{CosmosMongoDB.UnitTests/CosmosMongoDB.UnitTests.csproj => CosmosDocumentDB.UnitTests/CosmosDocumentDB.UnitTests.csproj} (73%)
rename MEVD/test/{CosmosMongoDB.UnitTests/CosmosMongoCollectionTests.cs => CosmosDocumentDB.UnitTests/CosmosDocumentDBCollectionTests.cs} (90%)
rename MEVD/test/{CosmosMongoDB.UnitTests/CosmosMongoHotelModel.cs => CosmosDocumentDB.UnitTests/CosmosDocumentDBHotelModel.cs} (93%)
rename MEVD/test/{CosmosMongoDB.UnitTests/CosmosMongoVectorStoreTests.cs => CosmosDocumentDB.UnitTests/CosmosDocumentDBVectorStoreTests.cs} (73%)
delete mode 100644 MEVD/test/CosmosMongoDB.ConformanceTests/ModelTests/CosmosMongoBasicModelTests.cs
delete mode 100644 MEVD/test/CosmosMongoDB.ConformanceTests/ModelTests/CosmosMongoNoDataModelTests.cs
delete mode 100644 MEVD/test/CosmosMongoDB.ConformanceTests/ModelTests/CosmosMongoNoVectorModelTests.cs
diff --git a/.github/workflows/mevd.yml b/.github/workflows/mevd.yml
index ba2e6ba..7456fa4 100644
--- a/.github/workflows/mevd.yml
+++ b/.github/workflows/mevd.yml
@@ -155,10 +155,10 @@ jobs:
fail-fast: false
matrix:
provider: ${{ fromJson(needs.discover.outputs.all_providers) }}
- # AzureAISearch and CosmosMongoDB require cloud instances and can't run in CI.
+ # AzureAISearch and CosmosDocumentDB require cloud instances and can't run in CI.
exclude:
- provider: AzureAISearch
- - provider: CosmosMongoDB
+ - provider: CosmosDocumentDB
steps:
- uses: actions/checkout@v6
diff --git a/CommunityToolkit.AI.slnx b/CommunityToolkit.AI.slnx
index f0c7ed0..ce0171a 100644
--- a/CommunityToolkit.AI.slnx
+++ b/CommunityToolkit.AI.slnx
@@ -10,7 +10,7 @@
-
+
@@ -25,8 +25,8 @@
-
-
+
+
diff --git a/MEVD/MEVD.slnf b/MEVD/MEVD.slnf
index 18885dd..8277058 100644
--- a/MEVD/MEVD.slnf
+++ b/MEVD/MEVD.slnf
@@ -5,7 +5,7 @@
[
"MEVD/src/AzureAISearch/AzureAISearch.csproj",
"MEVD/src/CosmosNoSql/CosmosNoSql.csproj",
- "MEVD/src/CosmosMongoDB/CosmosMongoDB.csproj",
+ "MEVD/src/CosmosDocumentDB/CosmosDocumentDB.csproj",
"MEVD/src/InMemory/InMemory.csproj",
"MEVD/src/PgVector/PgVector.csproj",
"MEVD/src/Qdrant/Qdrant.csproj",
@@ -18,8 +18,8 @@
"MEVD/test/AzureAISearch.ConformanceTests/AzureAISearch.ConformanceTests.csproj",
"MEVD/test/CosmosNoSql.UnitTests/CosmosNoSql.UnitTests.csproj",
"MEVD/test/CosmosNoSql.ConformanceTests/CosmosNoSql.ConformanceTests.csproj",
- "MEVD/test/CosmosMongoDB.UnitTests/CosmosMongoDB.UnitTests.csproj",
- "MEVD/test/CosmosMongoDB.ConformanceTests/CosmosMongoDB.ConformanceTests.csproj",
+ "MEVD/test/CosmosDocumentDB.UnitTests/CosmosDocumentDB.UnitTests.csproj",
+ "MEVD/test/CosmosDocumentDB.ConformanceTests/CosmosDocumentDB.ConformanceTests.csproj",
"MEVD/test/InMemory.UnitTests/InMemory.UnitTests.csproj",
"MEVD/test/InMemory.ConformanceTests/InMemory.ConformanceTests.csproj",
"MEVD/test/PgVector.UnitTests/PgVector.UnitTests.csproj",
diff --git a/MEVD/src/CosmosMongoDB/AssemblyInfo.cs b/MEVD/src/CosmosDocumentDB/AssemblyInfo.cs
similarity index 100%
rename from MEVD/src/CosmosMongoDB/AssemblyInfo.cs
rename to MEVD/src/CosmosDocumentDB/AssemblyInfo.cs
diff --git a/MEVD/src/CosmosMongoDB/CosmosMongoDB.csproj b/MEVD/src/CosmosDocumentDB/CosmosDocumentDB.csproj
similarity index 71%
rename from MEVD/src/CosmosMongoDB/CosmosMongoDB.csproj
rename to MEVD/src/CosmosDocumentDB/CosmosDocumentDB.csproj
index fb19b0f..75bcecc 100644
--- a/MEVD/src/CosmosMongoDB/CosmosMongoDB.csproj
+++ b/MEVD/src/CosmosDocumentDB/CosmosDocumentDB.csproj
@@ -2,17 +2,17 @@
1.0.0
- CommunityToolkit.VectorData.CosmosMongoDB
+ CommunityToolkit.VectorData.CosmosDocumentDB
$(AssemblyName)
net10.0;net8.0;netstandard2.1;net472
true
- Azure CosmosDB MongoDB vCore provider for Microsoft.Extensions.VectorData
- Azure CosmosDB MongoDB vCore provider for Microsoft.Extensions.VectorData by the .NET Community Toolkit
+ Azure DocumentDB vCore provider for Microsoft.Extensions.VectorData
+ Azure DocumentDB vCore provider for Microsoft.Extensions.VectorData by the .NET Community Toolkit
-
+
diff --git a/MEVD/src/CosmosMongoDB/CosmosMongoCollection.cs b/MEVD/src/CosmosDocumentDB/CosmosDocumentDBCollection.cs
similarity index 92%
rename from MEVD/src/CosmosMongoDB/CosmosMongoCollection.cs
rename to MEVD/src/CosmosDocumentDB/CosmosDocumentDBCollection.cs
index 766b533..6f83af0 100644
--- a/MEVD/src/CosmosMongoDB/CosmosMongoCollection.cs
+++ b/MEVD/src/CosmosDocumentDB/CosmosDocumentDBCollection.cs
@@ -15,15 +15,15 @@
using MEVD = Microsoft.Extensions.VectorData;
using Microsoft.Shared.Diagnostics;
-namespace CommunityToolkit.VectorData.CosmosMongoDB;
+namespace CommunityToolkit.VectorData.CosmosDocumentDB;
///
-/// Service for storing and retrieving vector records, that uses Azure CosmosDB MongoDB as the underlying storage.
+/// Service for storing and retrieving vector records, that uses Azure DocumentDB as the underlying storage.
///
/// The data type of the record key. Must be either .
/// The data model to use for adding, updating and retrieving data from storage.
#pragma warning disable CA1711 // Identifiers should not have incorrect suffix
-public class CosmosMongoCollection : VectorStoreCollection
+public class CosmosDocumentDBCollection : VectorStoreCollection
where TKey : notnull
where TRecord : class
#pragma warning restore CA1711 // Identifiers should not have incorrect suffix
@@ -40,10 +40,10 @@ public class CosmosMongoCollection : VectorStoreCollectionThe default options for vector search.
private static readonly MEVD.VectorSearchOptions s_defaultVectorSearchOptions = new();
- /// that can be used to manage the collections in Azure CosmosDB MongoDB.
+ /// that can be used to manage the collections in Azure DocumentDB.
private readonly IMongoDatabase _mongoDatabase;
- /// Azure CosmosDB MongoDB collection to perform record operations.
+ /// Azure DocumentDB collection to perform record operations.
private readonly IMongoCollection _mongoCollection;
/// Interface for mapping between a storage model, and the consumer record data model.
@@ -70,28 +70,28 @@ public class CosmosMongoCollection : VectorStoreCollection
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
- /// that can be used to manage the collections in Azure CosmosDB MongoDB.
- /// The name of the collection that this will access.
+ /// that can be used to manage the collections in Azure DocumentDB.
+ /// The name of the collection that this will access.
/// Optional configuration options for this class.
- [RequiresDynamicCode("This constructor is incompatible with NativeAOT. For dynamic mapping via Dictionary, instantiate CosmosMongoDynamicCollection instead.")]
- [RequiresUnreferencedCode("This constructor is incompatible with trimming. For dynamic mapping via Dictionary, instantiate CosmosMongoDynamicCollection instead.")]
- public CosmosMongoCollection(
+ [RequiresDynamicCode("This constructor is incompatible with NativeAOT. For dynamic mapping via Dictionary, instantiate CosmosDocumentDBDynamicCollection instead.")]
+ [RequiresUnreferencedCode("This constructor is incompatible with trimming. For dynamic mapping via Dictionary, instantiate CosmosDocumentDBDynamicCollection instead.")]
+ public CosmosDocumentDBCollection(
IMongoDatabase mongoDatabase,
string name,
- CosmosMongoCollectionOptions? options = default)
+ CosmosDocumentDBCollectionOptions? options = default)
: this(
mongoDatabase,
name,
static options => typeof(TRecord) == typeof(Dictionary)
- ? throw new NotSupportedException(VectorDataStrings.NonDynamicCollectionWithDictionaryNotSupported(typeof(CosmosMongoDynamicCollection)))
+ ? throw new NotSupportedException(VectorDataStrings.NonDynamicCollectionWithDictionaryNotSupported(typeof(CosmosDocumentDBDynamicCollection)))
: new MongoModelBuilder().Build(typeof(TRecord), typeof(TKey), options.Definition, options.EmbeddingGenerator),
options)
{
}
- internal CosmosMongoCollection(IMongoDatabase mongoDatabase, string name, Func modelFactory, CosmosMongoCollectionOptions? options)
+ internal CosmosDocumentDBCollection(IMongoDatabase mongoDatabase, string name, Func modelFactory, CosmosDocumentDBCollectionOptions? options)
{
// Verify.
Throw.IfNull(mongoDatabase);
@@ -102,7 +102,7 @@ internal CosmosMongoCollection(IMongoDatabase mongoDatabase, string name, Func CosmosMongoCollectionSearchMapping.GetSearchQueryForHnswIndex(
+ IndexKind.Hnsw => CosmosDocumentDBCollectionSearchMapping.GetSearchQueryForHnswIndex(
vector,
vectorProperty.StorageName,
itemsAmount,
_efSearch,
filter),
- IndexKind.IvfFlat => CosmosMongoCollectionSearchMapping.GetSearchQueryForIvfIndex(
+ IndexKind.IvfFlat => CosmosDocumentDBCollectionSearchMapping.GetSearchQueryForIvfIndex(
vector,
vectorProperty.StorageName,
itemsAmount,
filter),
_ => throw new InvalidOperationException(
- $"Index kind '{vectorProperty.IndexKind}' on {nameof(VectorStoreVectorProperty)} '{vectorProperty.StorageName}' is not supported by the Azure CosmosDB for MongoDB VectorStore. " +
+ $"Index kind '{vectorProperty.IndexKind}' on {nameof(VectorStoreVectorProperty)} '{vectorProperty.StorageName}' is not supported by the Azure DocumentDB VectorStore. " +
$"Supported index kinds are: {string.Join(", ", [IndexKind.Hnsw, IndexKind.IvfFlat])}")
};
- var projectionQuery = CosmosMongoCollectionSearchMapping.GetProjectionQuery(
+ var projectionQuery = CosmosDocumentDBCollectionSearchMapping.GetProjectionQuery(
ScorePropertyName,
DocumentPropertyName);
@@ -406,7 +406,7 @@ _ when vectorProperty.EmbeddingGenerationDispatcher is not null
// Add score threshold filter as a $match stage if specified
if (options.ScoreThreshold.HasValue)
{
- pipeline.Add(CosmosMongoCollectionSearchMapping.GetScoreThresholdMatchQuery(ScorePropertyName, options.ScoreThreshold.Value));
+ pipeline.Add(CosmosDocumentDBCollectionSearchMapping.GetScoreThresholdMatchQuery(ScorePropertyName, options.ScoreThreshold.Value));
}
const string OperationName = "Aggregate";
@@ -455,7 +455,7 @@ public override async IAsyncEnumerable GetAsync(
options ??= new();
// Translate the filter now, so if it fails, we throw immediately.
- var translatedFilter = new CosmosMongoFilterTranslator().Translate(filter, _model);
+ var translatedFilter = new CosmosDocumentDBFilterTranslator().Translate(filter, _model);
SortDefinition? sortDefinition = null;
var orderBy = options.OrderBy?.Invoke(new()).Values;
@@ -503,13 +503,13 @@ private async Task CreateIndexesAsync(string collectionName, CancellationToken c
var indexArray = new BsonArray();
- indexArray.AddRange(CosmosMongoCollectionCreateMapping.GetVectorIndexes(
+ indexArray.AddRange(CosmosDocumentDBCollectionCreateMapping.GetVectorIndexes(
_model.VectorProperties,
uniqueIndexes,
_numLists,
_efConstruction));
- indexArray.AddRange(CosmosMongoCollectionCreateMapping.GetFilterableDataIndexes(
+ indexArray.AddRange(CosmosDocumentDBCollectionCreateMapping.GetFilterableDataIndexes(
_model.DataProperties,
uniqueIndexes));
diff --git a/MEVD/src/CosmosMongoDB/CosmosMongoCollectionCreateMapping.cs b/MEVD/src/CosmosDocumentDB/CosmosDocumentDBCollectionCreateMapping.cs
similarity index 84%
rename from MEVD/src/CosmosMongoDB/CosmosMongoCollectionCreateMapping.cs
rename to MEVD/src/CosmosDocumentDB/CosmosDocumentDBCollectionCreateMapping.cs
index 3a7a814..2070f1d 100644
--- a/MEVD/src/CosmosMongoDB/CosmosMongoCollectionCreateMapping.cs
+++ b/MEVD/src/CosmosDocumentDB/CosmosDocumentDBCollectionCreateMapping.cs
@@ -5,12 +5,12 @@
using Microsoft.Extensions.VectorData.ProviderServices;
using MongoDB.Bson;
-namespace CommunityToolkit.VectorData.CosmosMongoDB;
+namespace CommunityToolkit.VectorData.CosmosDocumentDB;
///
-/// Contains mapping helpers to use when creating a collection in Azure CosmosDB MongoDB.
+/// Contains mapping helpers to use when creating a collection in Azure DocumentDB.
///
-internal static class CosmosMongoCollectionCreateMapping
+internal static class CosmosDocumentDBCollectionCreateMapping
{
///
/// Returns an array of indexes to create for vector properties.
@@ -104,25 +104,25 @@ public static BsonArray GetFilterableDataIndexes(
}
///
- /// More information about Azure CosmosDB for MongoDB index kinds here: .
+ /// More information about Azure DocumentDB index kinds here: .
///
private static string GetIndexKind(string? indexKind, string vectorPropertyName)
- => CosmosMongoCollectionSearchMapping.GetVectorPropertyIndexKind(indexKind) switch
+ => CosmosDocumentDBCollectionSearchMapping.GetVectorPropertyIndexKind(indexKind) switch
{
IndexKind.Hnsw => "vector-hnsw",
IndexKind.IvfFlat => "vector-ivf",
- _ => throw new NotSupportedException($"Index kind '{indexKind}' on {nameof(VectorStoreVectorProperty)} '{vectorPropertyName}' is not supported by the Azure CosmosDB for MongoDB VectorStore.")
+ _ => throw new NotSupportedException($"Index kind '{indexKind}' on {nameof(VectorStoreVectorProperty)} '{vectorPropertyName}' is not supported by the Azure DocumentDB VectorStore.")
};
///
- /// More information about Azure CosmosDB for MongoDB distance functions here: .
+ /// More information about Azure DocumentDB distance functions here: .
///
private static string GetDistanceFunction(string? distanceFunction, string vectorPropertyName)
- => CosmosMongoCollectionSearchMapping.GetVectorPropertyDistanceFunction(distanceFunction) switch
+ => CosmosDocumentDBCollectionSearchMapping.GetVectorPropertyDistanceFunction(distanceFunction) switch
{
DistanceFunction.CosineDistance => "COS",
DistanceFunction.DotProductSimilarity => "IP",
DistanceFunction.EuclideanDistance => "L2",
- _ => throw new NotSupportedException($"Distance function '{distanceFunction}' for {nameof(VectorStoreVectorProperty)} '{vectorPropertyName}' is not supported by the Azure CosmosDB for MongoDB VectorStore.")
+ _ => throw new NotSupportedException($"Distance function '{distanceFunction}' for {nameof(VectorStoreVectorProperty)} '{vectorPropertyName}' is not supported by the Azure DocumentDB VectorStore.")
};
}
diff --git a/MEVD/src/CosmosMongoDB/CosmosMongoCollectionOptions.cs b/MEVD/src/CosmosDocumentDB/CosmosDocumentDBCollectionOptions.cs
similarity index 74%
rename from MEVD/src/CosmosMongoDB/CosmosMongoCollectionOptions.cs
rename to MEVD/src/CosmosDocumentDB/CosmosDocumentDBCollectionOptions.cs
index 0fc2d8e..9944e3e 100644
--- a/MEVD/src/CosmosMongoDB/CosmosMongoCollectionOptions.cs
+++ b/MEVD/src/CosmosDocumentDB/CosmosDocumentDBCollectionOptions.cs
@@ -3,23 +3,23 @@
using Microsoft.Extensions.VectorData;
-namespace CommunityToolkit.VectorData.CosmosMongoDB;
+namespace CommunityToolkit.VectorData.CosmosDocumentDB;
///
-/// Options when creating a .
+/// Options when creating a .
///
-public sealed class CosmosMongoCollectionOptions : VectorStoreCollectionOptions
+public sealed class CosmosDocumentDBCollectionOptions : VectorStoreCollectionOptions
{
- internal static readonly CosmosMongoCollectionOptions Default = new();
+ internal static readonly CosmosDocumentDBCollectionOptions Default = new();
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
- public CosmosMongoCollectionOptions()
+ public CosmosDocumentDBCollectionOptions()
{
}
- internal CosmosMongoCollectionOptions(CosmosMongoCollectionOptions? source) : base(source)
+ internal CosmosDocumentDBCollectionOptions(CosmosDocumentDBCollectionOptions? source) : base(source)
{
NumLists = source?.NumLists ?? Default.NumLists;
EfConstruction = source?.EfConstruction ?? Default.EfConstruction;
diff --git a/MEVD/src/CosmosMongoDB/CosmosMongoCollectionSearchMapping.cs b/MEVD/src/CosmosDocumentDB/CosmosDocumentDBCollectionSearchMapping.cs
similarity index 94%
rename from MEVD/src/CosmosMongoDB/CosmosMongoCollectionSearchMapping.cs
rename to MEVD/src/CosmosDocumentDB/CosmosDocumentDBCollectionSearchMapping.cs
index 3aadb66..cd6d78d 100644
--- a/MEVD/src/CosmosMongoDB/CosmosMongoCollectionSearchMapping.cs
+++ b/MEVD/src/CosmosDocumentDB/CosmosDocumentDBCollectionSearchMapping.cs
@@ -5,12 +5,12 @@
using MongoDB.Bson;
-namespace CommunityToolkit.VectorData.CosmosMongoDB;
+namespace CommunityToolkit.VectorData.CosmosDocumentDB;
///
-/// Contains mapping helpers to use when searching for documents using Azure CosmosDB MongoDB.
+/// Contains mapping helpers to use when searching for documents using Azure DocumentDB.
///
-internal static class CosmosMongoCollectionSearchMapping
+internal static class CosmosDocumentDBCollectionSearchMapping
{
/// Returns index kind specified on vector property or default .
public static string GetVectorPropertyIndexKind(string? indexKind) => !string.IsNullOrWhiteSpace(indexKind) ? indexKind! : MongoConstants.DefaultIndexKind;
@@ -98,7 +98,7 @@ public static BsonDocument GetProjectionQuery(string scorePropertyName, string d
/// Returns a $match stage to filter results by score threshold.
///
- /// Cosmos MongoDB returns a similarity score where higher values mean more similar,
+ /// Cosmos DocumentDB returns a similarity score where higher values mean more similar,
/// so we filter with $gte to keep results at or above the threshold.
///
public static BsonDocument GetScoreThresholdMatchQuery(string scorePropertyName, double scoreThreshold)
diff --git a/MEVD/src/CosmosMongoDB/CosmosMongoConstants.cs b/MEVD/src/CosmosDocumentDB/CosmosDocumentDBConstants.cs
similarity index 67%
rename from MEVD/src/CosmosMongoDB/CosmosMongoConstants.cs
rename to MEVD/src/CosmosDocumentDB/CosmosDocumentDBConstants.cs
index 83dd2e9..ca68c87 100644
--- a/MEVD/src/CosmosMongoDB/CosmosMongoConstants.cs
+++ b/MEVD/src/CosmosDocumentDB/CosmosDocumentDBConstants.cs
@@ -2,9 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.
-namespace CommunityToolkit.VectorData.CosmosMongoDB;
+namespace CommunityToolkit.VectorData.CosmosDocumentDB;
-internal static class CosmosMongoConstants
+internal static class CosmosDocumentDBConstants
{
public const string VectorStoreSystemName = "azure.cosmosdbmongodb";
}
diff --git a/MEVD/src/CosmosMongoDB/CosmosMongoDynamicCollection.cs b/MEVD/src/CosmosDocumentDB/CosmosDocumentDBDynamicCollection.cs
similarity index 74%
rename from MEVD/src/CosmosMongoDB/CosmosMongoDynamicCollection.cs
rename to MEVD/src/CosmosDocumentDB/CosmosDocumentDBDynamicCollection.cs
index b5b9a7d..0404675 100644
--- a/MEVD/src/CosmosMongoDB/CosmosMongoDynamicCollection.cs
+++ b/MEVD/src/CosmosDocumentDB/CosmosDocumentDBDynamicCollection.cs
@@ -4,22 +4,22 @@
using MongoDB.Driver;
-namespace CommunityToolkit.VectorData.CosmosMongoDB;
+namespace CommunityToolkit.VectorData.CosmosDocumentDB;
///
/// Represents a collection of vector store records in a Mongo database, mapped to a dynamic Dictionary<string, object?>.
///
#pragma warning disable CA1711 // Identifiers should not have incorrect suffix
-public sealed class CosmosMongoDynamicCollection : CosmosMongoCollection