Created
May 27, 2015 09:28
-
-
Save xaxxon/99c30dec4b9017643911 to your computer and use it in GitHub Desktop.
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
Meteor.setInterval (-> | |
# console.log "Checking for old chats #{moment().subtract 10, 'seconds'}" | |
# Delete stored chat elements older than threshold | |
# meteor:PRIMARY> db.rooms.update({}, {$pull: {"chat":{date: {$lt: 1432208317490}}}}) | |
room_collection.update {}, | |
$pull: | |
chat: | |
date: | |
$lt: moment().subtract(10, "seconds").valueOf(), | |
{multi: true} | |
(error)-> console.log error if error | |
), 1000 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment