在猫鼬中空闲连接超时

时间:2015-10-22 12:55:25

标签: mongodb mongoose

有没有办法在mongoose中设置空闲连接超时? 我试着像下面的那个。

mongoose.createConnection(IP:port/{server:{"maxIdleTimeMS":1800000}})

但上面的代码似乎不起作用。任何帮助将不胜感激

1 个答案:

答案 0 :(得分:0)

此选项称为connectTimeoutMS而不是maxIdleTimeMS,它是一个套接字选项。这是一个有效的示例代码:

SELECT  A.Affiliate,
        B.DiallerOutcome,
        ISNULL(COUNT(C.DiallerOutcome),0) [No. of Leads]
FROM (  SELECT DISTINCT Affiliate
        FROM dbo.AffiliateLeads) A
CROSS JOIN dbo.DiallerOutcomes B
LEFT JOIN dbo.AffiliateLeads C
    ON A.Affiliate = C.Affiliate
    AND B.DiallerOutcome = C.DiallerOutcome
GROUP BY A.Affiliate,
         B.DiallerOutcome
ORDER BY A.Affiliate,
         B.DiallerOutcome;
祝你好运