add convert querySet and Document to json functions