@@ -8,7 +8,7 @@ class Builder extends \Illuminate\Database\Query\Builder {
8
8
/**
9
9
* The database collection
10
10
*
11
- * @var string
11
+ * @var MongoCollection
12
12
*/
13
13
public $ collection ;
14
14
@@ -247,8 +247,6 @@ public function whereBetween($column, array $values, $boolean = 'and')
247
247
248
248
$ this ->wheres [] = compact ('column ' , 'type ' , 'boolean ' , 'values ' );
249
249
250
- $ this ->bindings = array_merge ($ this ->bindings , $ values );
251
-
252
250
return $ this ;
253
251
}
254
252
@@ -366,8 +364,7 @@ public function decrement($column, $amount = 1, array $extra = array())
366
364
*/
367
365
public function delete ($ id = null )
368
366
{
369
- $ query = $ this ->compileWheres ();
370
- $ result = $ this ->collection ->remove ($ query );
367
+ $ result = $ this ->collection ->remove ($ this ->compileWheres ());
371
368
372
369
if (1 == (int ) $ result ['ok ' ])
373
370
{
@@ -405,6 +402,16 @@ public function truncate()
405
402
return (1 == (int ) $ result ['ok ' ]);
406
403
}
407
404
405
+ /**
406
+ * Get a new instance of the query builder.
407
+ *
408
+ * @return Builder
409
+ */
410
+ public function newQuery ()
411
+ {
412
+ return new Builder ($ this ->connection );
413
+ }
414
+
408
415
/**
409
416
* Compile the where array
410
417
*
@@ -414,6 +421,7 @@ private function compileWheres()
414
421
{
415
422
if (!$ this ->wheres ) return array ();
416
423
424
+ // The new list of compiled wheres
417
425
$ wheres = array ();
418
426
419
427
foreach ($ this ->wheres as $ i =>&$ where )
@@ -535,14 +543,4 @@ private function compileWherebetween($where)
535
543
);
536
544
}
537
545
538
- /**
539
- * Get a new instance of the query builder.
540
- *
541
- * @return Builder
542
- */
543
- public function newQuery ()
544
- {
545
- return new Builder ($ this ->connection );
546
- }
547
-
548
546
}
0 commit comments