hi .. are you sending your "timestamp" field as a Date or is it a String and its failing ?
I did some quick test with a timeseries collection and this worked for me
Function node to prepare a msg.payload for the mongodb out node set to Insert :
msg.payload = {
"timestamp": new Date(),
"value1": 33,
"value2": 12
}
return msg;
Flow:
[{"id":"dc742398782aab73","type":"inject","z":"54efb553244c241f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":1080,"wires":[["07beb63e4e603c82"]]},{"id":"07beb63e4e603c82","type":"function","z":"54efb553244c241f","name":"function 1","func":"msg.payload = {\n \"timestamp\": new Date(),\n \"value1\": 33,\n \"value2\": 12\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":1080,"wires":[["79b70be061685cef","676f99158b209fc6"]]},{"id":"79b70be061685cef","type":"debug","z":"54efb553244c241f","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":590,"y":980,"wires":[]},{"id":"676f99158b209fc6","type":"mongodb out","z":"54efb553244c241f","mongodb":"39adf9d0.a8c876","name":"","collection":"test2","payonly":true,"upsert":false,"multi":false,"operation":"insert","x":730,"y":1080,"wires":[]},{"id":"39adf9d0.a8c876","type":"mongodb","hostname":"localhost","topology":"direct","connectOptions":"useUnifiedTopology=true","port":"27017","db":"nodered","name":""}]
If you give us more information of the stucture of data that come from the S7 node maybe we can help
to tweak the code based on your project.