Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dictionary 如何使用map检索cloudant数据库中存储的图像_Dictionary_Cloudant_Nosql - Fatal编程技术网

Dictionary 如何使用map检索cloudant数据库中存储的图像

Dictionary 如何使用map检索cloudant数据库中存储的图像,dictionary,cloudant,nosql,Dictionary,Cloudant,Nosql,通过使用此函数,我能够检索所有字符串详细信息 public static Task fromRevision(BasicDocumentRevision rev) { Task t = new Task(); t.rev = rev; // this could also be done by a fancy object mapper Map<String, Object> map = rev.asMap(); if(map.contains

通过使用此函数,我能够检索所有字符串详细信息

public static Task fromRevision(BasicDocumentRevision rev) {
    Task t = new Task();
    t.rev = rev;
    // this could also be done by a fancy object mapper
    Map<String, Object> map = rev.asMap();
    if(map.containsKey("type") && map.get("type").equals(Task.DOC_TYPE)) {
        t.setType((String) map.get("type"));
        t.setCompleted((Boolean) map.get("completed"));
        t.setDescription((String) map.get("description"));
       t.setName((String) map.get("name"));
        t.setPhone((String) map.get("phone"));
        t.setAddress((String) map.get("address"));
        t.setSubdescription((String) map.get("subdescription"));
        t.setPrice((String) map.get("price"));
        t.setLocation((String) map.get("location"));
        t.setArea((String) map.get("area"));
        t.setInfo((String) map.get("info"));
        t.setCity((String) map.get("city"));
        return t;
    }
    return null;
}
来自修订版的公共静态任务(基本文档修订版){
任务t=新任务();
t、 rev=rev;
//这也可以通过一个奇特的对象映射器来完成
Map Map=rev.asMap();
if(map.containsKey(“type”)和&map.get(“type”)等于(Task.DOC_type)){
t、 setType((String)map.get(“type”);
t、 setCompleted((布尔)map.get(“completed”);
t、 setDescription((String)map.get(“description”);
t、 setName((String)map.get(“name”);
t、 setPhone((字符串)map.get(“phone”);
t、 setAddress((字符串)map.get(“地址”);
t、 setSubdescription((字符串)map.get(“subdescription”);
t、 setPrice((字符串)map.get(“price”);
t、 setLocation((String)map.get(“location”);
t、 setArea((String)map.get(“area”);
t、 setInfo((String)map.get(“info”);
t、 setCity((String)map.get(“city”);
返回t;
}
返回null;
}
现在我想检索存储为附件的图像。
我应该在这段代码中添加什么?

要从
基本文档修订版
中获取附件,您可以访问附件地图,其中附件始终由附件的名称键入,因此您需要做的是:

Attachment attachment = rev.attachments.get("attachmentName");