Implementing algorithms for finding similiar documents in mongo db