I am using pymongo used mapreduced function to get result but i want alternative for map reduce like group
===

"tags" : ["MongoDB", "Map/Reduce", "Recipe"]

m = Code("function () {""  this.tags.forEach(function(z) {""    emit(z, 1);""  });""}")
   
    r = Code("function (key, values) {var count = 0;for (var i = 0; i < values.length; i++) {count += values[i];}return count;}")

db.coll.map_reduce(m,r, out = "map_tags",query={"tags": {"$ne": ''},"organization":orgid},safe=True)

i can get correct result by above code but i need alternative solution for this....
bcz mapreduce creating more collections in my db.......    

thanks in advance