如果我有很多像下面这样的数组,
{
"_id" : ObjectId("51f21c47564f4a9f411baf8d"),
"Gender" : [
{
"key" : "m",
"desc" : "male"
}
]
}
{
"_id" : ObjectId("51f21c9a564f4a9f411baf8e"),
"marital status" : [
{
"key" : "m",
"desc" : "married"
},
{
"key" : "s",
"desc" : "single"
}
]
}
如果存在则替换整个数组并在不存在时创建新数组的查询是什么?