var shortLinks = [];
Link.find({}).exec(function (err, links) {
if (err) {
console.log(err);
} else {
links.map(link => {
shortLinks.push(link.shortLink);
});
}
});
console.log(shortLinks); // тут массив пустой
var shortLinks = Link.find().exec();
// ...
shortLinks.then(function(links){
// work with links
}, function(err){
// some error
});