Shows 'Warning: Accessing non-existent property' for count, findOne, remove and updateOne and then shows an error while connecting to MongoDB