How to update a document in NEST whose document ID (which is autogenerated) is not known?

[Route("api/CancelSlotAppointment")]
[HttpGet]
public string CancelSlotAppointment(string SlotID, bool Cancel)
{
var uri = new Uri("http://localhost:9200");
var settings = new ConnectionSettings(uri);
var client = new ElasticClient(settings);
var result = client.Update(SlotID, u => u
.Index("slot_booking")
.Doc(new
{
BookingCanceled = Cancel
}
));

        return result.ToString();
    }

{

            "_index": "slot_booking",

            "_type": "_doc",

            "_id": "0NJZMYABHXYXREFD-lWQ",

            "_score": 1.0,

            "_source": {

                "SlotID": "200",

                "PracticeID": "100",

                "BookingCanceled": false,

                "Confirm": false

            }

        }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.