Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremy Mikola <jmikola@gmail.com>
  • Loading branch information
GromNaN and jmikola authored Jul 11, 2023
1 parent b13e7e0 commit b258fac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"license": "MIT",
"require": {
"ext-mongodb": "*",
"ext-mongodb": "^1.15",
"illuminate/support": "^10.0",
"illuminate/container": "^10.0",
"illuminate/database": "^10.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public function cursor($columns = [])
}

/**
* Return the MongoDB Query to be run in the form of an element array like ['method' => [arguments]].
* Return the MongoDB query to be run in the form of an element array like ['method' => [arguments]].
*
* Example: ['find' => [['name' => 'John Doe'], ['projection' => ['birthday' => 1]]]]
*
Expand Down
11 changes: 5 additions & 6 deletions tests/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1273,10 +1273,7 @@ public function testBasicWhereInsException()
$this->expectException(\InvalidArgumentException::class);
$builder = $this->getBuilder();
$builder->whereIn('id', [
[
'a' => 1,
'b' => 1,
],
['a' => 1, 'b' => 1],
['c' => 2],
[3],
]);
Expand Down Expand Up @@ -1474,7 +1471,8 @@ public function testLatest()
$this->assertSame(['find' => [[], ['sort' => ['created_at' => -1], 'limit' => 1, 'typeMap' => ['root' => 'array', 'document' => 'array']]]], $builder->toMql());

$builder = $this->getBuilder();
$builder->latest('updated_at');$this->assertSame(['find' => [[], ['sort' => ['updated_at' => -1], 'typeMap' => ['root' => 'array', 'document' => 'array']]]], $builder->toMql());
$builder->latest('updated_at');
$this->assertSame(['find' => [[], ['sort' => ['updated_at' => -1], 'typeMap' => ['root' => 'array', 'document' => 'array']]]], $builder->toMql());
}

/** @see DatabaseQueryBuilderTest::testOldest() */
Expand All @@ -1489,7 +1487,8 @@ public function testOldest()
$this->assertSame(['find' => [[], ['sort' => ['created_at' => 1], 'limit' => 1, 'typeMap' => ['root' => 'array', 'document' => 'array']]]], $builder->toMql());

$builder = $this->getBuilder();
$builder->oldest('updated_at');$this->assertSame(['find' => [[], ['sort' => ['updated_at' => 1], 'typeMap' => ['root' => 'array', 'document' => 'array']]]], $builder->toMql());
$builder->oldest('updated_at');
$this->assertSame(['find' => [[], ['sort' => ['updated_at' => 1], 'typeMap' => ['root' => 'array', 'document' => 'array']]]], $builder->toMql());
}

/** @see DatabaseQueryBuilderTest::testReorder() */
Expand Down

0 comments on commit b258fac

Please sign in to comment.