| 2954 | |
| 2955 | |
| 2956 | static pgbson * |
| 2957 | SerializeUpdateOneResult(UpdateOneResult *result) |
| 2958 | { |
| 2959 | pgbson_writer writer; |
| 2960 | PgbsonWriterInit(&writer); |
| 2961 | |
| 2962 | PgbsonWriterAppendBool(&writer, "isRowUpdated", -1, result->isRowUpdated); |
| 2963 | PgbsonWriterAppendBool(&writer, "updateSkipped", -1, result->updateSkipped); |
| 2964 | PgbsonWriterAppendBool(&writer, "isRetry", -1, result->isRetry); |
| 2965 | |
| 2966 | if (result->reinsertDocument != NULL) |
| 2967 | { |
| 2968 | PgbsonWriterAppendDocument(&writer, "reinsertDocument", -1, |
| 2969 | result->reinsertDocument); |
| 2970 | } |
| 2971 | |
| 2972 | if (result->resultDocument != NULL) |
| 2973 | { |
| 2974 | PgbsonWriterAppendDocument(&writer, "resultDocument", -1, result->resultDocument); |
| 2975 | } |
| 2976 | |
| 2977 | if (result->upsertedObjectId != NULL) |
| 2978 | { |
| 2979 | PgbsonWriterAppendDocument(&writer, "upsertedObjectId", -1, |
| 2980 | result->upsertedObjectId); |
| 2981 | } |
| 2982 | |
| 2983 | return PgbsonWriterGetPgbson(&writer); |
| 2984 | } |
| 2985 | |
| 2986 | |
| 2987 | /* Serializes the batch update result as a pgbson to be sent back to the coordinator. We return the raw response and ok: true if there were no write errors otherwise false. */ |
no test coverage detected