Skip to content

Commit 67040bd

Browse files
committed
Integer IDs can also be int32
1 parent 29bfcd9 commit 67040bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

php_phongo.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,10 @@ void phongo_writeresult_init(zval *return_value, const bson_t *bson, int server_
348348

349349
php_phongo_objectid_new_from_oid(zid, bson_iter_oid(&outer) TSRMLS_CC);
350350
add_index_zval(writeresult->upsertedIds, index, zid);
351+
} else if (BSON_ITER_HOLDS_INT32(&outer)) {
352+
int32_t val = bson_iter_int32(&outer);
353+
354+
add_index_long(writeresult->upsertedIds, index, val);
351355
} else if (BSON_ITER_HOLDS_INT64(&outer)) {
352356
int64_t val = bson_iter_int64(&outer);
353357

0 commit comments

Comments
 (0)