@@ -243,12 +243,14 @@ public function hint($index)
243
243
}
244
244
245
245
/** @inheritdoc */
246
+ #[Override]
246
247
public function find ($ id , $ columns = [])
247
248
{
248
249
return $ this ->where ('_id ' , '= ' , $ this ->convertKey ($ id ))->first ($ columns );
249
250
}
250
251
251
252
/** @inheritdoc */
253
+ #[Override]
252
254
public function value ($ column )
253
255
{
254
256
$ result = (array ) $ this ->first ([$ column ]);
@@ -257,12 +259,14 @@ public function value($column)
257
259
}
258
260
259
261
/** @inheritdoc */
262
+ #[Override]
260
263
public function get ($ columns = [])
261
264
{
262
265
return $ this ->getFresh ($ columns );
263
266
}
264
267
265
268
/** @inheritdoc */
269
+ #[Override]
266
270
public function cursor ($ columns = [])
267
271
{
268
272
$ result = $ this ->getFresh ($ columns , true );
@@ -579,6 +583,7 @@ public function generateCacheKey()
579
583
}
580
584
581
585
/** @return ($function is null ? AggregationBuilder : mixed) */
586
+ #[Override]
582
587
public function aggregate ($ function = null , $ columns = ['* ' ])
583
588
{
584
589
assert (is_array ($ columns ), new TypeError (sprintf ('Argument #2 ($columns) must be of type array, %s given ' , get_debug_type ($ columns ))));
@@ -640,9 +645,10 @@ public function aggregate($function = null, $columns = ['*'])
640
645
}
641
646
642
647
/**
643
- * {@inheritDoc}
648
+ * @param string $function
649
+ * @param array $columns
644
650
*
645
- * @see \Illuminate\Database\Query\Builder::aggregateByGroup()
651
+ * @return mixed
646
652
*/
647
653
public function aggregateByGroup (string $ function , array $ columns = ['* ' ])
648
654
{
@@ -654,6 +660,7 @@ public function aggregateByGroup(string $function, array $columns = ['*'])
654
660
}
655
661
656
662
/** @inheritdoc */
663
+ #[Override]
657
664
public function exists ()
658
665
{
659
666
return $ this ->first (['id ' ]) !== null ;
@@ -676,6 +683,7 @@ public function distinct($column = false)
676
683
*
677
684
* @inheritdoc
678
685
*/
686
+ #[Override]
679
687
public function orderBy ($ column , $ direction = 'asc ' )
680
688
{
681
689
if (is_string ($ direction )) {
@@ -697,6 +705,7 @@ public function orderBy($column, $direction = 'asc')
697
705
}
698
706
699
707
/** @inheritdoc */
708
+ #[Override]
700
709
public function whereBetween ($ column , iterable $ values , $ boolean = 'and ' , $ not = false )
701
710
{
702
711
$ type = 'between ' ;
@@ -721,6 +730,7 @@ public function whereBetween($column, iterable $values, $boolean = 'and', $not =
721
730
}
722
731
723
732
/** @inheritdoc */
733
+ #[Override]
724
734
public function insert (array $ values )
725
735
{
726
736
// Allow empty insert batch for consistency with Eloquent SQL
@@ -755,6 +765,7 @@ public function insert(array $values)
755
765
}
756
766
757
767
/** @inheritdoc */
768
+ #[Override]
758
769
public function insertGetId (array $ values , $ sequence = null )
759
770
{
760
771
$ options = $ this ->inheritConnectionOptions ();
@@ -774,6 +785,7 @@ public function insertGetId(array $values, $sequence = null)
774
785
}
775
786
776
787
/** @inheritdoc */
788
+ #[Override]
777
789
public function update (array $ values , array $ options = [])
778
790
{
779
791
// Use $set as default operator for field names that are not in an operator
@@ -790,6 +802,7 @@ public function update(array $values, array $options = [])
790
802
}
791
803
792
804
/** @inheritdoc */
805
+ #[Override]
793
806
public function upsert (array $ values , $ uniqueBy , $ update = null ): int
794
807
{
795
808
if ($ values === []) {
@@ -836,6 +849,7 @@ public function upsert(array $values, $uniqueBy, $update = null): int
836
849
}
837
850
838
851
/** @inheritdoc */
852
+ #[Override]
839
853
public function increment ($ column , $ amount = 1 , array $ extra = [], array $ options = [])
840
854
{
841
855
$ query = ['$inc ' => [(string ) $ column => $ amount ]];
@@ -856,6 +870,12 @@ public function increment($column, $amount = 1, array $extra = [], array $option
856
870
return $ this ->performUpdate ($ query , $ options );
857
871
}
858
872
873
+ /**
874
+ * @param array $options
875
+ *
876
+ * @inheritdoc
877
+ */
878
+ #[Override]
859
879
public function incrementEach (array $ columns , array $ extra = [], array $ options = [])
860
880
{
861
881
$ stage ['$addFields ' ] = $ extra ;
@@ -873,12 +893,14 @@ public function incrementEach(array $columns, array $extra = [], array $options
873
893
}
874
894
875
895
/** @inheritdoc */
896
+ #[Override]
876
897
public function decrement ($ column , $ amount = 1 , array $ extra = [], array $ options = [])
877
898
{
878
899
return $ this ->increment ($ column , -1 * $ amount , $ extra , $ options );
879
900
}
880
901
881
902
/** @inheritdoc */
903
+ #[Override]
882
904
public function decrementEach (array $ columns , array $ extra = [], array $ options = [])
883
905
{
884
906
$ decrement = [];
@@ -932,6 +954,7 @@ public function divide($column, $amount, array $extra = [], array $options = [])
932
954
}
933
955
934
956
/** @inheritdoc */
957
+ #[Override]
935
958
public function pluck ($ column , $ key = null )
936
959
{
937
960
$ results = $ this ->get ($ key === null ? [$ column ] : [$ column , $ key ]);
@@ -942,6 +965,7 @@ public function pluck($column, $key = null)
942
965
}
943
966
944
967
/** @inheritdoc */
968
+ #[Override]
945
969
public function delete ($ id = null )
946
970
{
947
971
// If an ID is passed to the method, we will set the where clause to check
@@ -973,6 +997,7 @@ public function delete($id = null)
973
997
}
974
998
975
999
/** @inheritdoc */
1000
+ #[Override]
976
1001
public function from ($ collection , $ as = null )
977
1002
{
978
1003
if ($ collection ) {
@@ -1012,6 +1037,7 @@ public function lists($column, $key = null)
1012
1037
*
1013
1038
* @template T
1014
1039
*/
1040
+ #[Override]
1015
1041
public function raw ($ value = null )
1016
1042
{
1017
1043
// Execute the closure on the mongodb collection
@@ -1114,11 +1140,13 @@ public function drop($columns)
1114
1140
*
1115
1141
* @inheritdoc
1116
1142
*/
1143
+ #[Override]
1117
1144
public function newQuery ()
1118
1145
{
1119
1146
return new static ($ this ->connection , $ this ->grammar , $ this ->processor );
1120
1147
}
1121
1148
1149
+ #[Override]
1122
1150
public function runPaginationCountQuery ($ columns = ['* ' ])
1123
1151
{
1124
1152
if ($ this ->distinct ) {
@@ -1201,6 +1229,7 @@ public function convertKey($id)
1201
1229
*
1202
1230
* @return $this
1203
1231
*/
1232
+ #[Override]
1204
1233
public function where ($ column , $ operator = null , $ value = null , $ boolean = 'and ' )
1205
1234
{
1206
1235
$ params = func_get_args ();
@@ -1714,6 +1743,7 @@ private function inheritConnectionOptions(array $options = []): array
1714
1743
}
1715
1744
1716
1745
/** @inheritdoc */
1746
+ #[Override]
1717
1747
public function __call ($ method , $ parameters )
1718
1748
{
1719
1749
if ($ method === 'unset ' ) {
@@ -1724,90 +1754,105 @@ public function __call($method, $parameters)
1724
1754
}
1725
1755
1726
1756
/** @internal This method is not supported by MongoDB. */
1757
+ #[Override]
1727
1758
public function toSql ()
1728
1759
{
1729
1760
throw new BadMethodCallException ('This method is not supported by MongoDB. Try "toMql()" instead. ' );
1730
1761
}
1731
1762
1732
1763
/** @internal This method is not supported by MongoDB. */
1764
+ #[Override]
1733
1765
public function toRawSql ()
1734
1766
{
1735
1767
throw new BadMethodCallException ('This method is not supported by MongoDB. Try "toMql()" instead. ' );
1736
1768
}
1737
1769
1738
1770
/** @internal This method is not supported by MongoDB. */
1771
+ #[Override]
1739
1772
public function whereColumn ($ first , $ operator = null , $ second = null , $ boolean = 'and ' )
1740
1773
{
1741
1774
throw new BadMethodCallException ('This method is not supported by MongoDB ' );
1742
1775
}
1743
1776
1744
1777
/** @internal This method is not supported by MongoDB. */
1778
+ #[Override]
1745
1779
public function whereFullText ($ columns , $ value , array $ options = [], $ boolean = 'and ' )
1746
1780
{
1747
1781
throw new BadMethodCallException ('This method is not supported by MongoDB ' );
1748
1782
}
1749
1783
1750
1784
/** @internal This method is not supported by MongoDB. */
1785
+ #[Override]
1751
1786
public function groupByRaw ($ sql , array $ bindings = [])
1752
1787
{
1753
1788
throw new BadMethodCallException ('This method is not supported by MongoDB ' );
1754
1789
}
1755
1790
1756
1791
/** @internal This method is not supported by MongoDB. */
1792
+ #[Override]
1757
1793
public function orderByRaw ($ sql , $ bindings = [])
1758
1794
{
1759
1795
throw new BadMethodCallException ('This method is not supported by MongoDB ' );
1760
1796
}
1761
1797
1762
1798
/** @internal This method is not supported by MongoDB. */
1799
+ #[Override]
1763
1800
public function unionAll ($ query )
1764
1801
{
1765
1802
throw new BadMethodCallException ('This method is not supported by MongoDB ' );
1766
1803
}
1767
1804
1768
1805
/** @internal This method is not supported by MongoDB. */
1806
+ #[Override]
1769
1807
public function union ($ query , $ all = false )
1770
1808
{
1771
1809
throw new BadMethodCallException ('This method is not supported by MongoDB ' );
1772
1810
}
1773
1811
1774
1812
/** @internal This method is not supported by MongoDB. */
1813
+ #[Override]
1775
1814
public function having ($ column , $ operator = null , $ value = null , $ boolean = 'and ' )
1776
1815
{
1777
1816
throw new BadMethodCallException ('This method is not supported by MongoDB ' );
1778
1817
}
1779
1818
1780
1819
/** @internal This method is not supported by MongoDB. */
1820
+ #[Override]
1781
1821
public function havingRaw ($ sql , array $ bindings = [], $ boolean = 'and ' )
1782
1822
{
1783
1823
throw new BadMethodCallException ('This method is not supported by MongoDB ' );
1784
1824
}
1785
1825
1786
1826
/** @internal This method is not supported by MongoDB. */
1827
+ #[Override]
1787
1828
public function havingBetween ($ column , iterable $ values , $ boolean = 'and ' , $ not = false )
1788
1829
{
1789
1830
throw new BadMethodCallException ('This method is not supported by MongoDB ' );
1790
1831
}
1791
1832
1792
1833
/** @internal This method is not supported by MongoDB. */
1834
+ #[Override]
1793
1835
public function whereIntegerInRaw ($ column , $ values , $ boolean = 'and ' , $ not = false )
1794
1836
{
1795
1837
throw new BadMethodCallException ('This method is not supported by MongoDB ' );
1796
1838
}
1797
1839
1798
1840
/** @internal This method is not supported by MongoDB. */
1841
+ #[Override]
1799
1842
public function orWhereIntegerInRaw ($ column , $ values )
1800
1843
{
1801
1844
throw new BadMethodCallException ('This method is not supported by MongoDB ' );
1802
1845
}
1803
1846
1804
1847
/** @internal This method is not supported by MongoDB. */
1848
+ #[Override]
1805
1849
public function whereIntegerNotInRaw ($ column , $ values , $ boolean = 'and ' )
1806
1850
{
1807
1851
throw new BadMethodCallException ('This method is not supported by MongoDB ' );
1808
1852
}
1809
1853
1810
1854
/** @internal This method is not supported by MongoDB. */
1855
+ #[Override]
1811
1856
public function orWhereIntegerNotInRaw ($ column , $ values , $ boolean = 'and ' )
1812
1857
{
1813
1858
throw new BadMethodCallException ('This method is not supported by MongoDB ' );
0 commit comments