我有以下文件:
{
"_id": 55d91b345ad7478c0c1a5c51,
"name": "pasa la plaza",
"testCases": [
{
"stateTestCase": "deberia jalar yo creo",
"_id": "55d91b5a5ad7478c0c1a5c52"
}
]
}
}
在测试用例[0]的位置,我有一个没有" startDate"的测试用例。领域。如果我更新testcase [0]应该创建" startDate"具有当前系统日期的字段:
"testCases": [
{
"stateTestCase": "field recently updated, will be created the startDate",
"_id": "55d91b5a5ad7478c0c1a5c52",
"startDate": "2015-08-23T04:00:00.000Z"
}
]
但是如果我要更新测试用例[0]应该只更新" stateTestCase"字段而不是" startDate"只能更新一次的字段。
"testCases": [
{
"stateTestCase": "field updated again, but not startDate",
"_id": "55d91b5a5ad7478c0c1a5c52",
"startDate": "2015-08-23T04:00:00.000Z"
}
]
有可能在猫鼬中做到这一点吗?如果是,那怎么样?