-1

I need to get the _id of all post_item being displayed in Telescope. It is not the posts_itens that are in the Collection but those being displayed.

Using Google Translate.

Cláudio Júlio
  • 365
  • 4
  • 16

1 Answers1

0

You can use cursor.map(), if you are trying to get an array with _id values of post_item elements:

var postIdsArr = Posts.find({}, {
    _id: 1
}).map(function(post) {
    return post._id;
});

Read more about the cursor.map() method.

Matthias A. Eckhart
  • 5,136
  • 4
  • 27
  • 34
  • I know that you are working with [Telescope](http://www.telescopeapp.org). Could you please edit your question and explain your desired result? – Matthias A. Eckhart Jul 25 '15 at 14:33