0
I have the following event being inserted into my Mongodb base
{
_id:"5c0539158863a16a282917ad",
owner:"clientX",
source:"Deposito01",
metric:"temperature",
datetime:"2018-12-03T12:09:25.000Z",
message:{
temperature:"-0.250000",
sensor:"sensor_0",
device_id:"client_dep123_temp",
local:"deposito_02",
cliente:"clientX",
awsRequestId:"xxxxx",
datetime:"2018-12-03T12:09:25.000Z"
}
}
I would like to return the last value of message.temperature
, grouping by the field source
, whenever the countryside metric
is equal to "temperature".
I would like to learn how a "search" of this type is structured, if it is necessary to exemplify with a code snippet, I am using python