How to use the admin_conn function from mongoose

Find comprehensive JavaScript mongoose.admin_conn code examples handpicked from public code repositorys.

84
85
86
87
88
89
90
bobjariSchema.statics.removeById = function (bobjariId) {
    return this.findByIdAndDelete(bobjariId);
};


module.exports = 
    mongoose.admin_conn.model('Bobjari', bobjariSchema)
fork icon0
star icon0
watch icon0

+ 2 other calls in file

4
5
6
7
8
9
10
    const mentorDetails = new this(payload)
    return mentorDetails.save()
}


module.exports =
    mongoose.admin_conn.model('MentorDetails', mentorDetailsSchema)
fork icon0
star icon0
watch icon0

26
27
28
29
30
31
32
                    }
                })
}


module.exports = 
    mongoose.admin_conn.model('Review', reviewSchema);
fork icon0
star icon0
watch icon0

39
40
41
42
43
44
45
                           'mentor': mentorId})
                .exec()
}


module.exports = 
    mongoose.admin_conn.model('Like', likeSchema)
fork icon0
star icon0
watch icon0

20
21
22
23
24
25
26
                {new: true})
                .exec()
}


module.exports =
    mongoose.admin_conn.model('MentorMeta', mentorMetaSchema)
fork icon0
star icon0
watch icon0

14
15
16
17
18
19
20
                .limit(Number(num))
                .exec()
}


module.exports =
    mongoose.admin_conn.model('Chat', chatSchema)
fork icon0
star icon0
watch icon0

100
101
102
103
104
105
106
107
}




// Create Model & Export
module.exports = 
    mongoose.admin_conn.model('Mentor', mentorSchema);
fork icon0
star icon0
watch icon0

10
11
12
13
14
15
16
    return this.find({'job': query})
                .limit(Number(num))
                .exec()
}


module.exports = mongoose.admin_conn.model('Job', jobSchema)
fork icon0
star icon0
watch icon0

77
78
79
80
81
82
83
userSchema.statics.removeById = function (userId) {
    return this.removeById(userId).exec()
}


module.exports = 
    mongoose.admin_conn.model('User', userSchema);
fork icon0
star icon0
watch icon0