unfortunatelly I haven't found the answer after some search and tries...
After insert the document below I received the id istiNGUBHVrkxpxfdqML
{
"person" : {
"brid" : "12345",
"name" : "Jonh",
"birthDate" : "1985-08-27",
"expirationDate" : "2018-08-13"
}
}
I would like to know if is possible to deal with the following situation in only one request.
If the user tries to add a document with the same brid and current date is before expirationDate, return the content of document id istiNGUBHVrkxpxfdqML. If not, insert a new document and return the new document id.
Is this possible?