Re: Problem with Struct when Insert MongoDB

12 views
Skip to first unread message

Tyler Brock

unread,
May 22, 2013, 11:44:24 AM5/22/13
to mongod...@googlegroups.com
Not sure what the question is here, would you mind describing the problem a bit more?

On Tuesday, May 21, 2013 11:47:31 PM UTC-4, Vinh Phuoc wrote:
Dear all,

I have 2 structs,

type Common struct {
}

type Productfashion struct {
}

and 1 struct is all  (merge of 2 struct above)

type ProductfashionAll struct {
   Common
   Productfashion
}


When I using Labix Mgo to Insert data with struct is ProductfashionAll :

{
  "_id" : ObjectId("519c3cbcf0461d88946f5533"),
  "common" : {
    "id" : 350,
    "name" : "Sơ mi TYS xanh chấm bi phối ren tay cánh dơi",
    "description" : "<table style=\"width: 382px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><colgroup><col width=\"382\" /></colgroup>\r\n<tbody>\r\n<tr>\r\n<td class=\"xl66\"
    "short_description" : "",
    "sku" : "10_350",
    "weight" : 300.0,
    "status" : 1,
    "url_key" : "",
    "visibility" : 4,
    "sku_user" : "",
    "unit_type" : "{\"id\":\"1\",\"value\":\"C\\u00e1i\"}",
  }
  "productfashion" : {
    "chat_lieu_1" : "{\"attribute_id\":\"285\",\"name\":\"Ch\\u1ea5t li\\u1ec7u\",\"show_required\":1,\"type\":\"String\",\"value\":[{\"option_id\":\"643\",\"value\":\"V\\u1ea3i\"}]}",
    "xuat_xu" : "{\"attribute_id\":\"333\",\"name\":\"Xu\\u1ea5t x\\u1ee9\",\"show_required\":1,\"type\":\"String\",\"value\":[{\"option_id\":\"1426\",\"value\":\"Vi\\u1ec7t Nam\"}]}",
    "kich_thuoc_1" : "{\"attribute_id\":\"298\",\"name\":\"K\\u00edch th\\u01b0\\u1edbc\",\"show_required\":1,\"type\":\"Option\",\"value\":[{\"option_id\":\"817\",\"value\":\"L\"},{\"option_id\":\"816\",\"value\":\"M\"},{\"option_id\":\"815\",\"value\":\"S\"}]}",
    "kieu_dang_1" : "{\"attribute_id\":\"302\",\"name\":\"Ki\\u1ec3u d\\u00e1ng\",\"show_required\":0,\"type\":\"String\",\"value\":[{\"option_id\":\"877\",\"value\":\"Ng\\u1eafn tay\"}]}",
    "mau_sac" : "{\"attribute_id\":\"284\",\"name\":\"M\\u00e0u s\\u1eafc\",\"show_required\":1,\"type\":\"Option\",\"value\":[{\"option_id\":\"634\",\"value\":\"Xanh\"}]}",
    "co_ao" : ""
}
}

I want remove common and productfashion :(

Thanks very much.

}


Reply all
Reply to author
Forward
0 new messages