Hi
I have the following request that works fine in Robo 3T:
db.getCollection("medias").find({deleted:true,updated_at:{$gte:ISODate("2022-04-01T00:00:00.000Z"),$lt:ISODate("2022-04-15T00:00:00.000Z")}})
But I don't seem to be able to convert the date-range part in Node-RED using node-red-node-mongodb
I've used a function node in front of the mongodb-in node:
with:
msg.payload = {
deleted: true,
updated_at: {
$gte: new Date("2022-01-01T00:00:00.000Z"),
$lt: new Date("2022-05-15T00:00:00.000Z")
}
}
return msg;
If I only have the deleted: true
part, the request works fine and I get all records.
But the date-range check doesn't work
I tried with "$gte"
and "$lt"
but no better luck
I've search for some mongoose sample codes as I believe the node is using that library
Any idea what I've could done wrong ?
Thanks