The group() function is kind of an old form of achieving results like this, it will also not work with sharded collections. Better to familiarize yourself with aggregate:
db.collection.aggregate([
{"$group": { "_id": null, "toplam": {"$sum": "$play"} }}
]);
Output for you driver will just be a cursor just like using find.
for PHP Syntax
For the record, your usage seems to be way off. Much as above you just translate the relative JSON to Dicts, and if that is still a problem then use a JSON parser to show you how. All the arguments are valid JSON, so I'm reminding myself to do this for all examples now, so people can easily dump into their own language.
db.collection.group({
"key": {},
"reduce": "function(curr, result) { result.total += curr.play; }",
"initial": { "total": 0 }
})
But still, don't use this anyway. Stick to aggregate, it's a useful tool to learn.
Of course in all cases, make sure that all your data being applied to a sum is actually a number, or things will blow up on you.