Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When debugging meteor client side, how do you view collection or cursor contents?

I'm attempting to debug the client side of a meteor app. How do I see the contents of a collection? More specifically, how do I view the contents of a LocalCollection.Cursor as I would a plain object in the console?

On the server side, db.collectionName.find() will output JSON and db.collectionName.find().pretty() makes a collection's contents easy to read and inspect. How would I do something similar on the client side with the 'minimongo' collections?

like image 552
Diogenes Avatar asked Dec 31 '12 04:12

Diogenes


2 Answers

You can do Collection.find({}).fetch() to see an array of objects in the collection. Then, you can expand each object to see its properties.

like image 81
Ajay Tatachar Avatar answered Oct 04 '22 20:10

Ajay Tatachar


Ya that's true, there is another way of doing that too,
This is what I was doing MyCollection.find({});
and in console I go in this manner
collection->docs->{{your-data-here}}.

like image 34
nicolsondsouza Avatar answered Oct 04 '22 20:10

nicolsondsouza