'Adds a document to the doc dict.'

def upsert(self, doc, namespace, timestamp):

    if doc.get('_upsert_exception'):
        raise Exception('upsert    exception')
    doc_id = doc['_id']
    self.doc_dict[doc_id] = Entry(doc=doc, ns=namespace, ts=timestamp)
