我在蒙戈這樣的數據:如何從mongo複雜子域中提取數據?
{
"_id" : ObjectId("562096f4a80ea920d4281719"),
"uid" : 162,
"name" : "Black & White D",
"article" : [ ],
"attributes" : [
{
"name" : "brand",
"value" : "APPLE",
"display" : "APPLE"
},
{
"name" : "color",
"value" : "NONE",
"display" : "Multi"
},
{
"name" : "gender",
"value" : "women",
"display" : "Women"
}
],
"categories" : [
ObjectId("5620961ea80ea920d42816c2"),
ObjectId("5620961ea80ea920d42816ca")
],
"collections" : [ ],
"images" : [
"http://www.apple.com/media/pictures/tagged_items/original/[email protected]_WHITE/1.jpg",
"http://www.apple.com/media/pictures/tagged_items/original/[email protected]_WHITE/2.jpg",
"http://www.apple.com/media/pictures/tagged_items/original/[email protected]_WHITE/3.jpg",
"http://www.apple.com/media/pictures/tagged_items/original/[email protected]_WHITE/4.jpg"
],
"created_on" : ISODate("2015-10-16T11:49:32.679Z"),
"similar_products" : [
ObjectId("562096f9a80ea920d1281694"),
ObjectId("5641daf9a80ea94a0f11310c"),
ObjectId("5620972ca80ea920d3281748"),
ObjectId("562f6643a80ea96e4231ec16"),
ObjectId("562096f8a80ea920d32816ab"),
ObjectId("5620972ca80ea920d228170c"),
ObjectId("56209728a80ea920d428178b"),
ObjectId("562f5e28a80ea96e4431ec0f"),
ObjectId("562096f7a80ea920d228169e"),
ObjectId("562096f3a80ea920d2281697")
],
"pynd_a_Sit_available" : true,
"item_code" : "[email protected]_WHITE",
"has_articles" : false,
"is_active" : true,
"description" : [
{
"text" : " perfect one.",
"details" : [ ],
"title" : "Style Note"
},
{
"text" : "Very good product.",
"details" : [
{
"key" : "Year",
"value" : "2015"
},
{
"key" : "Product Sit",
"value" : "Regular Sit"
},
{
"key" : "Material",
"value" : "Synthetic"
},
{
"key" : "Season",
"value" : "Autumn"
},
{
"key" : "Ocassion",
"value" : "Casual"
},
{
"key" : "Product Type",
"value" : "Heavy"
},
{
"key" : "Gender",
"value" : "Women"
}
],
"title" : "Product Details"
}
],
"share_key" : "74bf9f"
}
我怎樣才能檢索蒙戈查詢「屬性」數據每種產品?
我需要所有「uid」的「品牌」,「顏色」和「性別」。
你的問題是有點不清楚,你可以展示你的預期產出與某些給定輸入什麼改進? – chridam
您嘗試了什麼,您期望的輸出是什麼? – Yogesh