我正在使用猫鼬,而我仅使用mongo DB。
这是我的架构
date: { type: String },
branchDetailId: { type: String },
times: [
{
time: { type: String },
totalOrderCount: { type: String },
orderId: [String],
},
],
这是我的数据在数组中的时间
"times": [
{
"orderId": [
"5e8178b1b315ee022277e80b",
"5e8178b1b315ee022277e80b"
],
"_id": ObjectID("5e82ed1c4e553a0874cdad94"),
"deleted": false,
"time": "11.00",
"totalOrderCount": "2",
"deletedAt": null
},
{
"orderId": [
"5e8178b1b315ee022277e803b",
"5e8178b1b315ee0222773e80b"
],
"_id": ObjectID("5e82ed1c4e553a0874cdad95"),
"deleted": false,
"time": "12.00",
"totalOrderCount": "2",
"deletedAt": null
}
],
我和我的订单编号
"ertertretretet"
//这是示例订单ID
我想将我的orderId输入time.times:11:00
类似的东西
if(times.times == "11.00"){
push orderId into DB in object time == 11.00 filed
}