Last active
July 3, 2018 10:31
-
-
Save luojiyin1987/df2ced13705d62c79ab2422f605a63c9 to your computer and use it in GitHub Desktop.
[nodejs mongoose 想获得find的值] #异步
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function couldSendSMS(mobile) { | |
| SMSLog.model.find() | |
| .where('mobile', mobile) | |
| .sort({ expiredate: -1 }) | |
| .limit(1) | |
| .exec( function (err, smsLogs) { | |
| console.log("find ok"); | |
| return (smsLogs[0].expiredate < Date.now()); | |
| }); | |
| } | |
| var isNeedSend = couldSendSMS(mobile); //为什么isNeedSend 是undefine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment