0
MongoDB中的數據庫iPodia和收集OVS_DETAILS,我有一個紀錄如何解決find方法返回的mongoDB C++結果?
{ "_id" : ObjectId("57ab14508b16c9557dcfa316"), "dpid" : "202481588545212", "mac" : "b8:27:eb:28:a6:bc", "extranet_gateway_mac" : "f0:b4:29:52:8f:b6", "extranet_gateway_ip" : "192.168.31.1", "extranet_public_ip" : "59.66.214.24", "extranet_private_ip" : "192.168.31.118", "extranet_netmask" : "255.255.255.0", "intranet_cidr_prefix" : 22020096, "intranet_cidr_length" : 29, "persist" : 0, "timestamp" : 1470187766 }
auto cursor = db["OVS_DETAILS"].find({filter_builder.view});
for (auto&& doc : cursor) {
std::cout << bsoncxx::to_json(doc) << std::endl;
}
我怎樣才能解決這個結果呢?例如,通過鍵「持久」獲取值。