Moralis.Cloud.define("returnData", async (request) => {
const query = new Moralis.Query("PolygonTransactions");
let start=new Date(2022,03,28);
let end=new Date(2022,04,23);
const pipe=[
{
match:{
$expr:{
$and:[
{$gte:["$createdAt",start]},
{$lte:["$createdAt",end]}
]
}
}
}
];
const data=await query.aggregate(pipe);
return data;
});
The function returns [] although there exists data. I need to resolve this issue ASAP.