0
以下代碼返回id,title和content字段。我只需要ID和標題。massive-js限制結果列
db.laws.search({columns: ["title", "content"], term: req.params.text}, function(err,laws){
res.contentType('application/json');
res.send(JSON.stringify(laws));
});
我需要和相當於「選擇ID,標題來自法律......」。我在docs找不到任何東西。
我想避免for循環過濾不需要的列,效率不高。