I am getting [object Object] when i find a collection


#1

I am getting the value as [object Object] when I find Collection In Mobile app But I am able to find the Collection In the browser with same code can somebody please explain me why is it so and help me out

The code is shown below:

Template.example.events({
‘click .collectionButton’: function(event) {
event.preventDefault();
var idValue = event.currentTarget.id;
clothespdf = Clothes.findOne({’_id’: idValue});
console.log(clothespdf);
});

Where console.log(clothespdf); gives value as [object Object] in mobile app
and collection details in the browser without any error


#2

.findOne() returns a Document (an Object).


#3

Have you tried converting your object to a string using JSON.stringify?

 console.log(JSON.stringify(clothespdf));