public class myType
{
public int key1;
public int key2;
public int val1;
public int val2;
public int val3;
};
当我将myType
对象插入集合时,阅读没有问题。只是:
collection.FindAs<myType>(query);
获取对象:
"key1":key1, "key2":key2, "val1":val1, "val2":val2, "val3":val3
但是在 mapreduce(键被构造为两个字段的组合)之后,输出集合的结构略有修改。就像是
"_id" {"key1" : key1, "key2": key2}, "value" : {"val1":val1, "val2":val2, "val3":val3}
从输出集合中读取对象的方法是什么?