       # since bongo is not supporting them
       # we need to manually define following:
       #
-      #   - providedBy, originId, sourceCampaign (unique)
+      #   - { providedBy:1, originId:1, sourceCampaign:1 } (unique)
       #
 
       type            : 'sparse'

          callback null, reward


  @fetchEarnedAmount = secure (client, options, callback)->

    options = useDefault options
    options.originId = client.connection.delegate.getId()

    fetchEarnedReward options, (err, earnedReward)->
      return callback err  if err?


      # We can manually call this if we need.
      # JReward.calculateAndUpdateEarnedAmount options, callback


  @fetchEarnedAmount$ = secure (client, options, callback)->

    options.originId  = client.connection.delegate.getId()

    @fetchEarnedAmount options, callback


  @some$ = secure (client, selector, options, callback)->
