【发布时间】:2015-07-24 14:06:27
【问题描述】:
我需要在 Telescope 中显示所有 post_item 中的 _id。集合中的不是posts_itens,而是显示的那些。
使用谷歌翻译。
【问题讨论】:
-
恐怕现在没有简单的方法可以做到这一点。也许应该有。
标签: javascript meteor telescope
我需要在 Telescope 中显示所有 post_item 中的 _id。集合中的不是posts_itens,而是显示的那些。
使用谷歌翻译。
【问题讨论】:
标签: javascript meteor telescope
如果您尝试获取具有_id 值的数组post_item 元素,则可以使用cursor.map():
var postIdsArr = Posts.find({}, {
_id: 1
}).map(function(post) {
return post._id;
});
阅读更多关于cursor.map() method的信息。
【讨论】: