Javascript 如何使用MongoDB计算和更新NodeJS服务器上的实时日期/时间
我在MongoDB中有这样的“发货”数据Javascript 如何使用MongoDB计算和更新NodeJS服务器上的实时日期/时间,javascript,node.js,mongodb,server,cron,Javascript,Node.js,Mongodb,Server,Cron,我在MongoDB中有这样的“发货”数据 { "_id": { "$oid": "60aff39872c1b74891b254b8" }, "track": [], "packageId": "00001", "currentLocation": "currentLocation",
{ "_id": {
"$oid": "60aff39872c1b74891b254b8"
},
"track": [],
"packageId": "00001",
"currentLocation": "currentLocation",
"destination": "destination",
"origin": "XYZ CITY",
"bagsCount": 16,
"modeofTransport": "Air",
"createdBy": "abcd WarehouseAgent",
"handoverTo": {
"userId": {
"$oid": "60aaa09a3b985f3794738280"
}
},
"status": "Waiting For Verification",
"eta":??? //(Amount of time shipment will use to reach DESTINATION)
// how do I get "Eta" from the user and in which Format
}
问题
- 如何从用户处获取“eta”以及以何种格式(日期/时间)
- NodeJs服务器如何根据实际时间不断更新每个包的“eta”