Started work on updating playlistHandler.js for dedicated/individual userPlaylist and channelPlaylist document collections.
This commit is contained in:
parent
36ae90b7af
commit
0b7f99725d
11 changed files with 300 additions and 146 deletions
|
|
@ -17,13 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
|||
//NPM Imports
|
||||
const {mongoose} = require('mongoose');
|
||||
|
||||
//Local Imports
|
||||
const playlistSchema = require('./playlistSchema');
|
||||
|
||||
/**
|
||||
* DB Schema for Documents representing channel playlists
|
||||
*/
|
||||
const channelPlaylistProperties = new mongoose.Schema({
|
||||
const channelPlaylistSchema = new mongoose.Schema({
|
||||
channel: {
|
||||
type: mongoose.SchemaTypes.ObjectID,
|
||||
ref: "channel",
|
||||
|
|
@ -33,8 +30,5 @@ const channelPlaylistProperties = new mongoose.Schema({
|
|||
{
|
||||
discriminatorKey: 'location'
|
||||
});
|
||||
//Create 'channelPlaylistSchema' as descriminator of playlistSchema
|
||||
var channelPlaylistSchema = playlistSchema.discriminator('channel', channelPlaylistProperties);
|
||||
|
||||
//Export mongoose model based on channelPlaylistSchema
|
||||
module.exports = mongoose.model("channelPlaylists", channelPlaylistSchema);
|
||||
module.exports = channelPlaylistSchema;
|
||||
Loading…
Add table
Add a link
Reference in a new issue