Example #1
0
types::b_dbpointer element::get_dbpointer() const {
    CITER;

    uint32_t collection_len;
    const char* collection;
    const bson_oid_t* boid;
    bson_iter_dbpointer(&iter, &collection_len, &collection, &boid);

    oid v{reinterpret_cast<const char*>(boid->bytes), sizeof(boid->bytes)};

    return types::b_dbpointer{string_or_literal{collection, collection_len}, v};
}
Example #2
0
types::b_dbpointer element::get_dbpointer() const {
    BSONCXX_TYPE_CHECK(k_dbpointer);
    BSONCXX_CITER;

    uint32_t collection_len;
    const char* collection;
    const bson_oid_t* boid;
    bson_iter_dbpointer(&iter, &collection_len, &collection, &boid);

    oid v{reinterpret_cast<const char*>(boid->bytes), sizeof(boid->bytes)};

    return types::b_dbpointer{stdx::string_view{collection, collection_len}, v};
}