将req.request中的名称,值对保存到文件中

我希望能够像在console.log中所显示的一样,在req.query中保存名称值对(如下所示)。 到目前为止,当我试图将req.query的内容保存到文件中时,我得到了[object object]。 有人能帮我吗。 谢谢!

console.log(req.query) { field1: 'employee_id', field2: 'first', field3: 'last', field4: 'email', format: 'CSV', type1: 'numerical', type2: 'text', type3: 'text', type4: 'email' } 

我的代码保存req.query:

  fs.writeFile("./data/client_data", req.query, function(err) { if(err) throw err; console.log("The file was saved!"); });