def findRevisionsExtended(self): """ Find a document's revisions as extended result. @return (dict|None) """ return util.dig("_revs_info", self.find({"revs_info": True}))
def findRevisions(self): """ Find a document's revisions. @return (dict|None) """ return util.dig("_revisions", self.find({"revs": True}))
def getData(self, key = None): """ Get document data value. @param (str) key @return (mixed) """ if key != None: return util.dig(key, self.data) return self.data
def getData(self, key=None): """ Get document data value. @param (str) key @return (mixed) """ if key != None: return util.dig(key, self.data) return self.data
def getBodyData(self, key=None): """ Get body data (parsed). @param (str) key """ bodyData = {} # should parsed? if self.getHeader("Content-Type") == "application/json": bodyData = util.jsonDecode(self.body or "") if key != None: return util.dig(key, bodyData) return bodyData
def findAttachments(self, attEncInfo = False, attsSince = []): """ Find a document's attachments. @param (bool) attEncInfo @param (dict|None) attsSince @return (dict|None) """ query = {} query["attachments"] = True query["att_encoding_info"] = attEncInfo if attsSince: attsSinceArray = [] for attsSinceValue in attsSince: attsSinceArray.append('"%s"' % util.quote(attsSinceValue)) query["atts_since"] = "[%s]" % ",".join(attsSinceArray) return util.dig("_attachments", self.find(query))
def findAttachments(self, attEncInfo=False, attsSince=[]): """ Find a document's attachments. @param (bool) attEncInfo @param (dict|None) attsSince @return (dict|None) """ query = {} query["attachments"] = True query["att_encoding_info"] = attEncInfo if attsSince: attsSinceArray = [] for attsSinceValue in attsSince: attsSinceArray.append('"%s"' % util.quote(attsSinceValue)) query["atts_since"] = "[%s]" % ",".join(attsSinceArray) return util.dig("_attachments", self.find(query))