Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-mongodb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
laravel-mongodb
Commits
62611090
Commit
62611090
authored
Oct 02, 2017
by
David Furnes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue using chunkById with ObjectIDs.
parent
9dd27175
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
Builder.php
src/Jenssegers/Mongodb/Eloquent/Builder.php
+8
-0
Builder.php
src/Jenssegers/Mongodb/Query/Builder.php
+22
-0
No files found.
src/Jenssegers/Mongodb/Eloquent/Builder.php
View file @
62611090
...
...
@@ -143,6 +143,14 @@ class Builder extends EloquentBuilder
return
parent
::
decrement
(
$column
,
$amount
,
$extra
);
}
/**
* @inheritdoc
*/
public
function
chunkById
(
$count
,
callable
$callback
,
$column
=
'_id'
,
$alias
=
null
)
{
return
parent
::
chunkById
(
$count
,
$callback
,
$column
,
$alias
);
}
/**
* @inheritdoc
*/
...
...
src/Jenssegers/Mongodb/Query/Builder.php
View file @
62611090
...
...
@@ -600,6 +600,28 @@ class Builder extends BaseBuilder
return
$this
->
increment
(
$column
,
-
1
*
$amount
,
$extra
,
$options
);
}
/**
* @inheritdoc
*/
public
function
chunkById
(
$count
,
callable
$callback
,
$column
=
'_id'
,
$alias
=
null
)
{
return
parent
::
chunkById
(
$count
,
$callback
,
$column
,
$alias
);
}
/**
* @inheritdoc
*/
public
function
forPageAfterId
(
$perPage
=
15
,
$lastId
=
0
,
$column
=
'_id'
)
{
// When using ObjectIDs to paginate, we need to use a hex string as the
// "minimum" ID rather than the integer zero so the '$lt' query works.
if
(
$column
===
'_id'
&&
$lastId
===
0
)
{
$lastId
=
'000000000000000000000000'
;
}
return
parent
::
forPageAfterId
(
$perPage
,
$lastId
,
$column
);
}
/**
* @inheritdoc
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment