* Initializes the iterator from a pgbson at given path and sets the bson_value_t * struct found at the path */
| 690 | * struct found at the path |
| 691 | */ |
| 692 | void |
| 693 | PgbsonGetBsonValueAtPath(const pgbson *bson, const char *path, bson_value_t *value) |
| 694 | { |
| 695 | bson_iter_t documentIterator; |
| 696 | bson_iter_t iterator; |
| 697 | PgbsonInitIterator(bson, &documentIterator); |
| 698 | |
| 699 | if (!bson_iter_find_descendant(&documentIterator, path, &iterator)) |
| 700 | { |
| 701 | value->value_type = BSON_TYPE_EOD; |
| 702 | } |
| 703 | else |
| 704 | { |
| 705 | *value = *bson_iter_value(&iterator); |
| 706 | } |
| 707 | } |
| 708 | |
| 709 | |
| 710 | /* |
no test coverage detected