Converting mongo array to object with key-value pair
问题 I have a mongo document that contains an array of Strings, and I need to convert this particular array of strings into an array of object containing a key-value pair. Below is my curent appraoch to it. { "_id" : ObjectId("57e3720836e36f63695a2ef2"), "platform" : "A1", "available" : { "Community" : { "attributes" : { "type" : { "values" : [ "well-known", "simple", "complex" ], "defaultValue" : "well-known" }, [......] } Current Query: templateAttributes.find({platform:"V1"}).map(function(c){ /