简体   繁体   English

调试流星客户端时,如何查看集合或游标内容?

[英]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? 更具体地说,我如何查看LocalCollection.Cursor的内容,就像在控制台中查看普通对象一样?

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. 在服务器端, db.collectionName.find()将输出JSON和db.collectionName.find().pretty()使集合的内容易于阅读和检查。 How would I do something similar on the client side with the 'minimongo' collections? 如何在客户端使用'minimongo'系列做类似的事情?

You can do Collection.find({}).fetch() to see an array of objects in the collection. 您可以使用Collection.find({}).fetch()来查看集合中的对象数组。 Then, you can expand each object to see its properties. 然后,您可以展开每个对象以查看其属性。

Ya that's true, there is another way of doing that too, 雅,这是真的,还有另一种方式,
This is what I was doing MyCollection.find({}); 这就是我在做MyCollection.find({});
and in console I go in this manner 在控制台我这样做
collection->docs->{{your-data-here}}. 收藏 - >文件 - > {{您的数据,在这里}}。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM