Both for the sort in collections and tables, currently (as of main on April 16, 2026) the vectors there appear as lists of floats in the payload.
There's a little perf improvement in enabling $binary encoding.
Can be tested e.g. by inspecting payloads of this for collections:
[Fact]
public async Task Test_VectorWriteCollection()
{
var collectionName = "vectorWriteTestCollection";
try
{
// TODO replace with annotations in the class since 125 is in
var collOptions = new CollectionDefinition
{
Vector = new VectorOptions
{
Dimension = 3,
}
};
var collection = await fixture.Database.CreateCollectionAsync<BinaryVectorObject>(collectionName, collOptions);
var insertee = new BinaryVectorObject
{
_id = "001",
TheVector = new float[] {0.1f, -0.2f, 0.3f},
};
await collection.InsertOneAsync(insertee);
var findOptions = new DocumentFindOptions<BinaryVectorObject>()
{
Sort = Builders<BinaryVectorObject>.Sort.Vector(new float[] {-0.1f, 0.2f, -0.3f}),
};
var reread = await collection.FindOneAsync(findOptions);
Assert.Equal(insertee._id, reread._id);
}
finally
{
await fixture.Database.DropCollectionAsync(collectionName);
}
}
and e.g. the existing FindOne_Vector test for tables.
Both for the sort in collections and tables, currently (as of main on April 16, 2026) the vectors there appear as lists of floats in the payload.
There's a little perf improvement in enabling $binary encoding.
Can be tested e.g. by inspecting payloads of this for collections:
and e.g. the existing
FindOne_Vectortest for tables.