Guest User

Untitled

a guest
May 16th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. command =
  2.     group:
  3.         ns: 'pings'
  4.         cond:
  5.             'ts': { $lt: new Date }
  6.             'ip': 'some IP'
  7.         key: { ip: true }
  8.         initial: { count: 0 }
  9.         $reduce: (doc, out) ->
  10.             out.count++
  11.  
  12.  
  13. # The executing part
  14. mongoose.connection.db.executeDbCommand command, (err, docs) ->
  15.             console.log docs.documents[0].retval
Add Comment
Please, Sign In to add comment