在PHP里写mongodb的语句怎么写啊,感觉PHP官方的文档不是很全。。
比如这句应该怎么写
`
db.testprom.aggregate(
[
{
$group:{
_id: {coolie: "$cookie", ip: "$ip"},
cookie: {$push: "$cookie"},
ip: {$push: "$ip"},
user_id: {$push: "$user_id"},
net: {$push: "$net"},
}
}
]
). forEach(function(x){
db.temp1.insert(
{
cookie: x.cookie,
ip : x.ip,
user_id : x.user_id,
net : x.net,
}
);
});
`