aggregate cursor error
mehmetpolat opened this issue · comments
Hi @intekhabrizvi I'm using your mongodb library but I have a problem, I get this error when I query on mongoDB. I would be very happy if you help
$ops = array(
array('$lookup'=> array('from'=>'balances', 'localField'=> '_id', 'foreignField'=>"OrderID", 'as'=> "balances"))
);
$orders = $this->mongo_db->aggregate('orders', $ops);
print_r($orders);
Me too
Please help
I solved it but add 'cursor' in to my aggregate option.
Here is my full query code
```
$this->mongo_db->aggregate(
'user_infos',[
[
'$match' => ['phone' => $PhoneNumber],
],[
'$project' => [
'fullname' => 1,
'password' => 1,
'branch_id' => 1
]
],[
'$lookup' => [
'from' => 'company_branches',
'localField' => 'branch_id',
'foreignField' => '_id',
'as' => 'branchInfo'
]
],[
'cursor' => [ 'batchSize' => 0 ]
]
);
@daravichit Could you pls confirm your MongoDB pecl version ??
MongoDB pecl version
1.6.0alpha1
@daravichit you are using the wrong library, you need to use the current version of my library located here