请教大家一个js问题

#1
let tempArray = []
            news.toArray((err,items)=>{
                items.map(x=>{
                    tempArray.push({
                        "title":x.title,
                        "content":x.content,
                        "createTime":x.createTime
                    })
                })
            })
return tempArray  

请问怎样可以使tempArray被赋值之后再传回,现在这总是传回一个空数组

#2

代码贴全了吗?

#3

贴的差不多了吧,
news 是从mongodb里查出来的

    collection.find().toArray(function(err,docs){
                   console(docs)
     });     

换句话说就是怎么把这个docs赋值给一个数组