code: def _add_recent(self, doc, logged_id):
  		"Keep a tab on the most recent message for each channel"
  		spec = dict(channel=doc['channel'])
  		doc['ref'] = logged_id
  		doc.pop('_id')
  		self._recent.replace_one(spec, doc, upsert=Truef _add_recent(self, doc, logged_id):
  		"Keep a tab on the most recent message for each channel"
  		spec = dict(channel=doc['channel'])
  		doc['ref'] = logged_id
  		doc.pop('_id')
  		self._recent.replace_one(spec, doc, upsert=True)
docs: Keep a tab on the most recent message for each channel