You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!(Z_TYPE_P(filter) ==IS_ARRAY||Z_TYPE_P(filter) ==IS_OBJECT)) {
324
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "Expected filter to be array or object, %s given", zend_get_type_by_const(Z_TYPE_P(filter)));
325
-
return false;
323
+
if (bson_iter_init_find(&iter, bson, key) &&BSON_ITER_HOLDS_INT32(&iter)) {
324
+
returnbson_iter_int32(&iter);
326
325
}
327
-
convert_to_object(filter);
328
326
329
-
if (options) {
330
-
/* TODO: Ensure batchSize, limit, and skip are 32-bit */
if (modifiers&& !(Z_TYPE_P(modifiers) ==IS_ARRAY||Z_TYPE_P(modifiers) ==IS_OBJECT)) {
349
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "Expected modifiers to be array or object, %s given", zend_get_type_by_const(Z_TYPE_P(modifiers)));
if (bson_iter_init_find(&iter, options, "projection")) {
389
+
uint32_tlen=0;
390
+
constuint8_t*data=NULL;
358
391
359
-
if (projection&& !(Z_TYPE_P(projection) ==IS_ARRAY||Z_TYPE_P(projection) ==IS_OBJECT)) {
360
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "Expected projection to be array or object, %s given", zend_get_type_by_const(Z_TYPE_P(projection)));
392
+
if (! (BSON_ITER_HOLDS_DOCUMENT (&iter) ||BSON_ITER_HOLDS_ARRAY (&iter))) {
393
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "Expected projection to be array or object, %d given", bson_iter_type(&iter));
if (bson_iter_init_find(&iter, options, "sort")) {
402
+
bson_ttmp;
403
+
uint32_tlen=0;
404
+
constuint8_t*data=NULL;
371
405
372
-
if (sort&& !(Z_TYPE_P(sort) ==IS_ARRAY||Z_TYPE_P(sort) ==IS_OBJECT)) {
373
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "Expected sort to be array or object, %s given", zend_get_type_by_const(Z_TYPE_P(sort)));
406
+
if (! (BSON_ITER_HOLDS_DOCUMENT (&iter) ||BSON_ITER_HOLDS_ARRAY (&iter))) {
407
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "Expected sort to be array or object, %d given", bson_iter_type(&iter));
0 commit comments