File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -346,7 +346,7 @@ public function toMql(): array
346
346
$ aggregations = blank ($ this ->aggregate ['columns ' ]) ? [] : $ this ->aggregate ['columns ' ];
347
347
348
348
if (in_array ('* ' , $ aggregations ) && $ function === 'count ' ) {
349
- $ options = $ this ->inheritConnectionOptions ();
349
+ $ options = $ this ->inheritConnectionOptions ($ this -> options );
350
350
351
351
return ['countDocuments ' => [$ wheres , $ options ]];
352
352
}
Original file line number Diff line number Diff line change @@ -660,4 +660,13 @@ public function testDelete(): void
660
660
User::limit (null )->delete ();
661
661
$ this ->assertEquals (0 , User::count ());
662
662
}
663
+
664
+ public function testLimitCount (): void
665
+ {
666
+ $ count = User::where ('age ' , '>= ' , 20 )->count ();
667
+ $ this ->assertEquals (7 , $ count );
668
+
669
+ $ count = User::where ('age ' , '>= ' , 20 )->options (['limit ' => 3 ])->count ();
670
+ $ this ->assertEquals (3 , $ count );
671
+ }
663
672
}
You can’t perform that action at this time.
0 commit comments