我想使用 golang 动态地从 mongodb 集合中获取特定的键值对。
err := collection.Find(operations).Limit(2).All(&products)
我该怎么做,但它必须是动态的,因为选择键值对在我这边发生了变化:
收款文件:
{
"_id" : 168,
"entity_id" : "168",
"type_id" : "simple",
"attribute_set_id" : "24",
"entity_type_id" : "4",
"created_at" : "2013-10-31 14:51:18",
"has_options" : "0",
"required_options" : "0",
"sku" : "AIC-19000-16",
"updated_at" : "2016-11-22 21:04:46",
"base_type" : 154,
"table_shape" : 164,
"manufacturer" : 15,
"delivery" : "Free Delivery & Setup",
"visibility" : 4,
"tax_class_id" : 2,
"status" : 1,
"enable_googlecheckout" : 1,
"discontinued" : 0,
"featured_fme" : 0,
"featured_product" : 0,
"amxnotif_hide_alert" : 1,
"is_recurring" : 0,
"condition" : 3043,
"ships" : null,
"ignore_wisepricer" : 0,
"fedexable" : null,
"dropshipped" : 0,
"verified_by" : 3301,
"reward_point_product" : null,
"mw_reward_point_sell_product" : null,
"ashley_sale" : 0,
"disable_amazonpayments" : 0,
"for_configurables" : null,
"rfm" : 0,
"mk_stockmessage" : false,
"mk_hideshipdate" : 0,
"reviews_counter" : 0,
"mpn" : "19000-16",
"name" : "After Eight Titanium Leg Rectangular Dining Table",
"style" : "73",
"furniture_type" : "76",
"meta_title" : "After Eight Titanium Leg Rectangular Dining Table,
19000-16, Aico Furniture",
"meta_description" : "After Eight Titanium Leg Rectangular Dining
Table from Aico Furniture, 19003-88",
"options_container" : "container2",
"url_key" : "after-eight-titanium-leg-rectangular-dining-table",
"url_path" : "after-eight-titanium-leg-rectangular-dining-
}
Smart猫小萌
相关分类