no message
This commit is contained in:
@@ -13,7 +13,7 @@ const ProfileSchema = new Mongoose.Schema({
|
||||
"order" : { type: Number, default: 0 },
|
||||
"details": {
|
||||
"about": { type: String },
|
||||
"age": { type: Number, index: true, default: 0 },
|
||||
"age": { type: Number, index: true, defaulrt: 0 },
|
||||
"body": { type: String },
|
||||
"ethnicity": { type: String },
|
||||
"gender": { type: String },
|
||||
@@ -43,9 +43,6 @@ module.exports = {
|
||||
ProfileModel
|
||||
.find({})
|
||||
.sort({ order: 1 })
|
||||
.populate({
|
||||
path: 'details'
|
||||
})
|
||||
.populate({
|
||||
path: 'messages',
|
||||
select: 'order text image isUser',
|
||||
@@ -136,12 +133,6 @@ module.exports = {
|
||||
find: (e, find) => {
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
var query = ProfileModel.find(find);
|
||||
|
||||
if (!find.select.length || (find.select.length && find.length.indexOf('details'))) {
|
||||
query.populate({
|
||||
path: 'details'
|
||||
});
|
||||
}
|
||||
|
||||
if (!find.select.length || (find.select.length && find.length.indexOf('messages'))) {
|
||||
query.populate({
|
||||
|
||||
Reference in New Issue
Block a user