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