I try to translate a mongo query to Doctrine. I am new with Doctrine and PHP and I am unable to translate my query to doctrine.
I have been blocked for over two days now!
I can't understand the official references
Can anybody help me!
The query is that one:
db.prices.group( {
key: { product: 1, category:1 },
cond: { product: "1" },
reduce: function ( curr, result ) {
result.total += curr.amount;
},
initial: { total : 0 }
} )
The documents look like:
{
"_id" : ObjectId("52af22231852fcf313b49375"),
"product" : DBRef("products", ObjectId("529d8db11852fc7a2ac182ac")),
"category" : "1",
"date" : ISODate("2013-12-16T15:54:11Z"),
"price" : 51
}
Thank you!!