キーを持つ内部配列を引っ張る方法address1
"_id": 2,
"info": {
"address1": {
"city": {
"0": "Indore"
},
"state": {
"0": "MP"
}
},
"address2": {
"city": {
"0": "Mhow"
},
"state": {
"0": "MP"
}
}
}
データを削除した後は、次のようになります。
"_id": 2,
"info": {
"address1": {
"city": {
"0": "Indore"
},
"state": {
"0": "MP"
}
}
}
私はこれを使用しましたdb.info.update({"_id":2},{'$pull':{"info":{"address1":{'$exists':true}}}})
が、エラーが発生しますCannot apply $pull/$pullAll modifier to non-array