* Similar to PgbsonHasDocumentId but for bson_values */
| 1868 | * Similar to PgbsonHasDocumentId but for bson_values |
| 1869 | */ |
| 1870 | bool |
| 1871 | DocumentBsonValueHasDocumentId(const bson_value_t *document) |
| 1872 | { |
| 1873 | if (document->value_type != BSON_TYPE_DOCUMENT) |
| 1874 | { |
| 1875 | return false; |
| 1876 | } |
| 1877 | |
| 1878 | bson_iter_t it; |
| 1879 | BsonValueInitIterator(document, &it); |
| 1880 | return bson_iter_find(&it, "_id"); |
| 1881 | } |
| 1882 | |
| 1883 | |
| 1884 | /* |
no test coverage detected