* Appends given bson document to the writer with the specified path. */
| 1006 | * Appends given bson document to the writer with the specified path. |
| 1007 | */ |
| 1008 | void |
| 1009 | PgbsonWriterAppendDocument(pgbson_writer *writer, const char *path, uint32_t pathLength, |
| 1010 | const pgbson *bson) |
| 1011 | { |
| 1012 | bson_t rightBson; |
| 1013 | bson_init_static(&rightBson, (const uint8_t *) VARDATA_ANY(bson), |
| 1014 | (uint32_t) VARSIZE_ANY_EXHDR(bson)); |
| 1015 | if (!bson_append_document(&(writer->innerBson), path, pathLength, &rightBson)) |
| 1016 | { |
| 1017 | ereport(ERROR, (errcode(ERRCODE_DOCUMENTDB_BADVALUE), |
| 1018 | errmsg("adding document: failed due to document " |
| 1019 | "being too large"))); |
| 1020 | } |
| 1021 | } |
| 1022 | |
| 1023 | |
| 1024 | /* |
no outgoing calls
no test coverage detected