Database
[{"tags":["SQL","database","NoSQL"]},{"tags":["mongodb","database","PHP"]}]
Query
db.collection.aggregate([{"$unwind":{"path":"$tags"}},{"$group":{"_id":"$tags","count":{"$sum":1}}},{"$project":{"_id":0,"tag":"$_id","count":1}}])