So I have a node endpoint that fetches documents from mongodb. I am seperating data and data into variables because I want to do stuff with it and then chain both back into one varaible and send it.
const data = await Data.find(); const data1 = data.api.results; const data2 = data.api.results; // Do stuff const response = data1 + data2; res.send(JSON.stringify(response)); // with and without JSON.stringify I still get [object, Object]
Note: both mongodb documents have the exact same structure. Everything works fine if I just send one variable so I think it has to do with JSON.stringify.