Hi
I have a collection named Projects that contains an embedded document Customer, with an Id field that stores a Guid value from .NET (NUUID)
I’ve built the search index this way:
{
"mappings": {
"dynamic": false,
"fields": {
"Details": {
"fields": {
"Customer": {
"fields": {
"Id": {
"type": "objectId"
}
},
"type": "document"
},
},
"type": "document"
},
}
}
I’d like to know if this is the very best way to define the index in this particular case and, if so, how can I perform the query in the $search stage.
I’ve tried the code below, in C#, but it didn’t work:
new BsonDocument("equals",
new BsonDocument { new BsonElement("path", "Details.Customer.Id"),
new BsonElement("value", new BsonBinaryData(customerId, GuidRepresentation.CSharpLegacy)) });
Ele produziu a seguinte pipeline :
{ "equals" : { "path" : "Details.Customer.Id", "value" : CSUUID("d9e9e08b-11f7-4c38-ab42-85bff1e022d4") } }
E o seguinte erro:
“compound.filter[1].equals.value” must be a boolean or objectId"
How to implement this?
Thanks for now