Ejemplo n.º 1
0
        public async Task <IActionResult> DoctorPatient([FromBody] PatientAssign assign)
        {
            IMutateInBuilder <dynamic> builder = _bucket.MutateIn <dynamic>(assign.Doctor);

            builder.ArrayAddUnique("patients", assign.Patient, true);
            var result = await builder.ExecuteAsync();

            if (result.Success)
            {
                return(Ok(assign));
            }
            return(CouchbaseError(result));
        }
Ejemplo n.º 2
0
 public async Task <IActionResult> DoctorPatient([FromBody] PatientAssign assign)
 {
     /*
      * Step 7 - Mutating Part of a JSON Document
      *
      * Expected Results on Success...
      * {
      *     "doctor": "56fba9a4-7b28-4294-9d5c-f4841f4463ce",
      *     "patient": "f059fbb9-d2ea-48e1-8129-bc084c8b423f"
      * }
      *
      * Expected Results on Error...
      * {
      *     "code": 500,
      *     "message": "Document key does not exist"
      * }
      */
 }