   getRawMongoCollection(collectionName)
 
 
-callCounter = (method, args...) ->
-  Counters = getCounterCollection()
+callCounter = (method, collectionName, args...) ->
+  Counters = getCounterCollection(collectionName)
   if Meteor._wrapAsync?
     Meteor._wrapAsync(_.bind(Counters[method], Counters))(args...)
   else

    future.wait()


_deleteCounters = ->
  callCounter('remove', {}, {safe: true})


_incrementCounter = (counterName, amount = 1) ->
  newDoc = callCounter(
    'findAndModify',
    {_id: counterName},         # query
    null,                       # sort
    {$inc: {seq: amount}},      # update

  return newDoc.seq


_decrementCounter = (collectionName, counterName, amount = 1) ->
  _incrementCounter(collectionName, counterName, -amount)


_setCounter = (collectionName, counterName, value) ->
  callCounter(
    'update',
    collectionName,
    {_id: counterName},
    {$set: {seq: value}}
  )
