diff options
| author | Jules Laplace <jules@okfoc.us> | 2017-03-13 02:11:51 +0100 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2017-03-13 02:11:51 +0100 |
| commit | 7361873eec849daf7a2e367f05c91782c7e265ad (patch) | |
| tree | 40e32fb35c6836b508516f4d90e986de32d38038 /lib/okpush/db.js | |
| parent | 7cb6b91f674108a73cde7d641b0949e21efdf3b8 (diff) | |
fix push token invocation
Diffstat (limited to 'lib/okpush/db.js')
| -rw-r--r-- | lib/okpush/db.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/okpush/db.js b/lib/okpush/db.js index 09a2c3aa..001c06b5 100644 --- a/lib/okpush/db.js +++ b/lib/okpush/db.js @@ -67,7 +67,7 @@ function addToken (data) { return new PushToken(data).save() } function getAllIOSTokens (channel, cb) { - PushToken.find({ channel: channel, platform: 'ios' }, function (err, items) { + PushToken.distinct("token", { channel: channel, platform: 'ios' }, function (err, items) { if (err) return cb(err, null) var items = _.map(items, function (item) { return item.token @@ -76,7 +76,7 @@ function getAllIOSTokens (channel, cb) { }) } function getAllAndroidTokens (channel, cb) { - PushToken.find({ channel: channel, platform: 'android' }, function (err, items) { + PushToken.distinct("token", { channel: channel, platform: 'android' }, function (err, items) { if (err) return cb(err, null) var items = _.map(items, function (item) { return item.token @@ -85,7 +85,7 @@ function getAllAndroidTokens (channel, cb) { }) } function getAllTokens (channel, cb) { - PushToken.find({ channel: channel }, function (err, items) { + PushToken.distinct("token", { channel: channel }, function (err, items) { if (err) return cb(err, null) var items = _.map(items, function (item) { return _.pick(item, ['platform', 'token']) |
