merged primary-collection.cpp with document-collection.cpp