Hello, I have the following problem in setting up a query for MongoDB. The query was made as follows:
[
{
"$match": {
"$and": [
{
"$or": [{{created_at}}]
},
{
"current.ca5d147cbf24b1b5340cd02597f8931f4752cbff": {
"$eq": null
},
"current.a0100942feec7297fa71f45444030a1cbc5652d7": {
"$not": {
"$regex": "outbound"
}
},
"stages.SAL": {
"$exists": true
},
"$nor": [
{
"current.status": "deleted"
},
{
"current.lost_reason": "[PV] - Lead duplicado"
}
]
}
]
}
},
{
"$project": {
"_id": "$_id",
"__deal": "$deal_id",
"__dias": {
"$divide": [{
"$subtract": ["$stages.SAL", "$stages.MQL"]
}, 1000 * 60 * 60 * 24]
},
"__horas": {
"$divide": [{
"$subtract": ["$stages.SAL", "$stages.MQL"]
}, 3600000]
}
}
},
{
"$project": {
"_id": 0,
"__deal": 1,
"Dias": {
"$round": ["$__dias", 1]
},
"Horas": {
"$round": ["$__horas", 1]
}
}
},
{
"$sort": {
"Dias": - 1
}
}
]
But the following error is displayed:
Invalid JSON input. Position: 1255. Character: ‘*’.
I know it’s because of this here in the query:
"$divide": [{
"$subtract": ["$stages.SAL", "$stages.MQL"]
}, 1000 * 60 * 60 * 24]
How to resolve for json to accept the character * ??