* PgbsonInitFromIterDocumentValue initializes a pgbson structure from the * document that given value holds. */
| 587 | * document that given value holds. |
| 588 | */ |
| 589 | pgbson * |
| 590 | PgbsonInitFromDocumentBsonValue(const bson_value_t *value) |
| 591 | { |
| 592 | if (value->value_type != BSON_TYPE_DOCUMENT) |
| 593 | { |
| 594 | ereport(ERROR, (errmsg("expected a document to create a bson object"))); |
| 595 | } |
| 596 | |
| 597 | return PgbsonInitFromBuffer((char *) value->value.v_doc.data, |
| 598 | value->value.v_doc.data_len); |
| 599 | } |
| 600 | |
| 601 | |
| 602 | /* |
no test coverage detected