示例#1
0
文件: metadata.cpp 项目: songjundev/b
void CMetadata::_objBsonToJson(rapidjson::Value& json, mongo::BSONObj& bson)
{
	std::vector<mongo::BSONElement> values;
	bson.elems(values);
	for (uint i = 0; i<values.size(); ++i) {
		this->_fieldBsonToJson(json, values[i].fieldName(), bson);
	}
}
示例#2
0
文件: metadata.cpp 项目: songjundev/b
void CMetadata::fromBson(mongo::BSONObj& bson)
{
	std::vector<mongo::BSONElement> elements;
	bson.elems(elements);
	for (uint i = 0; i<elements.size(); ++i) {
		this->_fieldBsonToJson(m_members, elements[i].fieldName(), bson);
	}
}
示例#3
0
文件: metadata.cpp 项目: songjundev/b
void CMetadata::fromBson(mongo::BSONObj& bson, std::string key)
{
	rapidjson::Value& member = this->getFieldVal(m_members, key);

	std::vector<mongo::BSONElement> elements;
	bson.elems(elements);
	for (uint i = 0; i<elements.size(); ++i) {
		this->_fieldBsonToJson(member, elements[i].fieldName(), bson);
	}
}