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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -