大家好,我有一个集合名称 test_data,在这个集合中我有给定甲酸盐的数据
Data = [{
"_id" : "53fe7ae0ef038fee879263d5",
"chanal_id" : "can1",
"instrumentnam" : "New Demo Device",
"siteid" : "53fe741d66455060e003c2d8",
"locationid" : "53fe74a866455060e003c2db",
"timestamp" : 1406916000,
"status" : "online",
"msgtype" : "demographics",
"fps" : "5",
"people" : [
{
"id" : 1,
"age" : 23,
"gender" : "male",
"ethnicity" : null,
"mood" : "happy",
"ethnicity_mod" : "White",
"mood_mod" : "Happy",
"gender_mod" : "Female",
"age_mod" : 22
}
],
"dateUTC" : 1409190000
},
{
"_id" : "53fe7ae0ef038fee879263d6",
"chanel_id" : "can1",
"instrumentnam" : "New Demo Device",
"siteid" : "53fe741d66455060e003c2d8",
"locationid" : "53fe74a866455060e003c2db",
"timestamp" : 1406917800,
"status" : "online",
"msgtype" : "demographics",
"fps" : "5",
"people" : [
{
"id" : 2,
"age" : 16,
"gender" : "female",
"ethnicity" : null,
"mood" : "happy",
"ethnicity_mod" : "White",
"mood_mod" : "Happy"
}
],
"dateUTC" : 1409186528
},
{
"_id" : "53fe7ae0ef038fee879263d7",
"chanal_id" : "can1",
"instrumentnam" : "New Demo Device",
"siteid" : "53fe741d66455060e003c2d8",
"locationid" : "53fe74a866455060e003c2db",
"timestamp" : 1406918800,
"status" : "online",
"msgtype" : "demographics",
"fps" : "5",
"people" : [
{
"id" : 3,
"age" : 33,
"gender" : "male",
"ethnicity" : null,
"mood" : "happy",
"ethnicity_mod" : "White"
}
],
"dateUTC" : 1409186528
}
,
{
"_id" : "53fe7ae0ef038fee879263d8",
"chanal_id" : "can1",
"instrumentnam" : "New Demo Device",
"siteid" : "53fe741d66455060e003c2d8",
"locationid" : "53fe74a866455060e003c2db",
"timestamp" : 1406919800,
"status" : "online",
"msgtype" : "demographics",
"fps" : "5",
"people" : [
{
"id" : 4,
"age" : 45,
"gender" : "female",
"ethnicity" : null,
"mood" : "happy",
"age_mod" : 5
}
],
"dateUTC" : 1409186528
},
{
"_id" : "53fe7ae0ef038fee879263d9",
"chanal_id" : "can1",
"instrumentnam" : "New Demo Device",
"siteid" : "53fe741d66455060e003c2d8",
"locationid" : "53fe74a866455060e003c2db",
"timestamp" : 1406920800,
"status" : "online",
"msgtype" : "demographics",
"fps" : "5",
"people" : [
{
"id" : 5,
"age" : 14,
"gender" : "female",
"ethnicity" : null,
"mood" : "angry"
}
],
"dateUTC" : 1409186528
},
{
"_id" :"53ff927266455060e003c2e0",
"chanal_id" : "rtsp://192.168.1.83:554/live.sdp",
"instrumentnam" : "Test Device",
"siteid" : "53f62abf66455068373665ff",
"locationid" : "53f62bb86645506837366603",
"timestamp" : 1409258116,
"status" : "online",
"msgtype" : "demographics",
"fps" : "32",
"people" : [],
"dateUTC" : 1409258098
}]
这是 json 格式,我想要做什么 1. 我想在 linux 系统中将时间戳从 epoc 时间转换为 utc 时间。和 2. 我想在 linux 系统中使用 mongodb 代码将此 json 数据转换为 csv 格式。
所以任何人都可以帮我做这件事。