MongoDB $multiply operator PHP example? -
i'm trying multiple "point" fields.
$out = $kuponmac->aggregate( array('$match' => array('random'=>$random, 'ekleyen'=>$ekleyen)), array('$group' => array( '_id' => '$state', 'totalpop' => array('$multiply' => '$point') ) ), array( '$match' => array('totalpop' => array('$gte' => 0)) ) );
this code. i'm trying use multiply couldn't use correctly. how can make multiplication "point" fields?
i'm looking http://docs.mongodb.org/manual/reference/aggregation/multiply/ there's no detailed explanation or example.
could u me?
it says on page how works:
takes array of 1 or more numbers , multiples them, returning resulting product.
so do:
array('$multiply' => array('$point', '$othernumber'))
since cannot mulitply 1 number meaningfully.
Comments
Post a Comment