Skip to content

Commit

Permalink
Merge pull request #15 from uzrnem/master
Browse files Browse the repository at this point in the history
Support for regex
  • Loading branch information
DenchikBY authored Jul 6, 2017
2 parents 1214972 + 6d2ed37 commit 57c4624
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/MongoDB/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function chunk($size)

public function __toString()
{
if (gettype($this->array[0]) == 'object') {
if (isset($this->array[0]) && gettype($this->array[0]) == 'object') {
return json_encode($this->toArray());
} else {
return json_encode($this->array);
Expand Down
3 changes: 2 additions & 1 deletion src/MongoDB/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class Builder
'>' => '$gt',
'<' => '$lt',
'>=' => '$gte',
'<=' => '$lte'
'<=' => '$lte',
'%' => '$regex'
];

public function __construct($model)
Expand Down

0 comments on commit 57c4624

Please sign in to comment.