Используя mongodb, я пытаюсь удалить свойство (_id) из дочерней коллекции (ListingFeatures) его родительской коллекции (Listing).Другими словами, у меня есть объект Listing, в котором есть список объектов ListingFeature.ListingFeature имеет свойство _id, которое я пытаюсь удалить.
Вот команда, которую я попробовал, и я подумал, что она будет работать:
db.Listing.update( { "ListingFeatures._id": { $exists:true } }, { $unset: { "ListingFeatures._id": 1 } }, false, true);
Это выполнялось в течение ~ 30 минут до завершения (Листинг содержит 3 миллиона записей), он не выдавал никаких ошибок и не выдавал никаких сообщений о том, что он был успешным или неудачным, однако свойство Listing.ListingFeatures._id все еще существует.
Чего мне не хватает?
Вот урезанный образец документа Листинга.В конечном итоге я хочу удалить _id, CreateDate и UpdateDate из коллекций ListingFeatures.
{
"Address": "1080 DUNLAP ORPHANAGE RD",
"City": "Unincorporated",
"ListingFeatures": [
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Status: ACTIVE"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "County: Tipton"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Approximately 10 acre(s)"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "2 total full bath(s)"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "2 total half bath(s)"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "9 total rooms"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "2 stories"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Type: General Residential"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Master Bedroom is Carpet, Full Bath, Level 1, Walk-In Closet"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Basement is Partial, Unfinished"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Pool features: Above Ground"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "2 covered parking space(s)"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Yes car garage(s)"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Attached parking"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Cooling features: 220 Wiring, Dual System,Cooling"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Inclusions: Cooktop, Dishwasher, Gas Cooking, Microwave, Refrigerator, Satellite Dish, Self Cleaning Oven"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Lot features: Chain Fenced, Landscaped, Level, Some Trees, Wooded"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Lot size is between 10 and 20 acres"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Utilities present: Public Water, Septic Tank"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Swimming pool(s)"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Basement"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Den"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Laundry room"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Hardwood floors"
},
{
"_id": null,
"CreateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"UpdateDate": "Sun, 03 Apr 2011 19:40:04 GMT -04:00",
"Name": "Parking features: Driveway/Pad, Garage Door Opener(s), Storage Room(s), Workshop(s)"
}
],
"ZipCode": "38011",
"_id": {
"$oid": "4d99055b1b9ba917bcef9443"
}
}