I assume you are using the mongodb driver,which you did not specify.
collection.find
returns a mongodb cursor , not an array of documents. You can use toArray to get the documents :
collection.find().toArray(function(e,docs){
...
}
I suggest your read the documentation of the library before using it,because you just can guess what an api does.