I just started to experiment with MongoDB as storage for my flows. I store some weather information using node-red-node-mongodb
I would like to execute (MongoDB):
db.getCollection('weather').remove({ _id: { $lt: ObjectId.fromDate(new Date(new Date().getTime() - 60 * 60*1000)) } })
Every 1 hr to remove old entries. Unfortunately, when I trigger inject function with text
I have a reply:
MongoError: BSON field 'delete.deletes.q' is the wrong type 'string', expected type 'object'
When I set inject node to output type to JSON
, NodeRED won't even accept this: Bad string
Any way to overcome this? Simple inserts are working alright, data is being populated in collection no problem.