redundant code removed.
isCollection field added to mongo documents.

the field helps to identifiy collections/documents with better performance.