Files
landing_page/qdrant-landing/content/documentation/headless/snippets/insert-points/with-payload/csharp.cs
T
xzfc 74a785218b Fix type-checking errors in snippets (code only, no .md)
This commit both:
- Fixes pre-existing mistakes in snippets, aka wrong code samples.
- Adds hidden (`@hide`) statements that do not appear in the docs,
  but satisfy typecheckers.
2025-11-28 22:02:07 +00:00

40 lines
1002 B
C#

using Qdrant.Client;
using Qdrant.Client.Grpc;
public class Snippet
{
public static async Task Run()
{
var client = new QdrantClient("localhost", 6334);
await client.UpsertAsync(
collectionName: "{collection_name}",
points: new List<PointStruct>
{
new PointStruct
{
Id = 1,
Vectors = new[] { 0.05f, 0.61f, 0.76f, 0.74f },
Payload = { ["city"] = "Berlin", ["price"] = 1.99 }
},
new PointStruct
{
Id = 2,
Vectors = new[] { 0.19f, 0.81f, 0.75f, 0.11f },
Payload = { ["city"] = new[] { "Berlin", "London" } }
},
new PointStruct
{
Id = 3,
Vectors = new[] { 0.36f, 0.55f, 0.47f, 0.94f },
Payload =
{
["city"] = new[] { "Berlin", "Moscow" },
["price"] = new Value[] { 1.99, 2.99 }
}
}
}
);
}
}