aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/pods.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-06-28 20:10:32 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-06-28 20:10:32 +0200
commit00057e85a703713a8f0d96e01c49978be0987eb2 (patch)
tree54735435062d2ededa72448de9fcaa677cf2c79c /server/models/pods.js
parentaaf61f3810e6d57c5130af959bd2860df32775e7 (diff)
downloadPeerTube-00057e85a703713a8f0d96e01c49978be0987eb2.tar.gz
PeerTube-00057e85a703713a8f0d96e01c49978be0987eb2.tar.zst
PeerTube-00057e85a703713a8f0d96e01c49978be0987eb2.zip
Request model refractoring -> use mongoose api
Diffstat (limited to 'server/models/pods.js')
-rw-r--r--server/models/pods.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/models/pods.js b/server/models/pods.js
index daeadeb07..9502d92e4 100644
--- a/server/models/pods.js
+++ b/server/models/pods.js
@@ -1,6 +1,7 @@
1'use strict' 1'use strict'
2 2
3const mongoose = require('mongoose') 3const mongoose = require('mongoose')
4const map = require('lodash/map')
4 5
5const constants = require('../initializers/constants') 6const constants = require('../initializers/constants')
6const logger = require('../helpers/logger') 7const logger = require('../helpers/logger')
@@ -76,7 +77,11 @@ function list (callback) {
76} 77}
77 78
78function listAllIds (callback) { 79function listAllIds (callback) {
79 return PodsDB.find({}, { _id: 1 }, callback) 80 return PodsDB.find({}, { _id: 1 }, function (err, pods) {
81 if (err) return callback(err)
82
83 return callback(null, map(pods, '_id'))
84 })
80} 85}
81 86
82function listAllUrls (callback) { 87function listAllUrls (callback) {