* ConvertPgbsonToBsonValue returns a bson value based on given document. * * That means, it doesn't copy raw bytes of given document but returns a * bson value view for it. */
| 660 | * bson value view for it. |
| 661 | */ |
| 662 | bson_value_t |
| 663 | ConvertPgbsonToBsonValue(const pgbson *document) |
| 664 | { |
| 665 | bson_value_t value = { |
| 666 | .value_type = BSON_TYPE_DOCUMENT, |
| 667 | .value.v_doc.data = (uint8_t *) VARDATA_ANY(document), |
| 668 | .value.v_doc.data_len = (uint32_t) VARSIZE_ANY_EXHDR(document) |
| 669 | }; |
| 670 | |
| 671 | return value; |
| 672 | } |
| 673 | |
| 674 | |
| 675 | /* |
no outgoing calls
no test coverage detected