Skip to content

Commit

Permalink
add Article model index on field user
Browse files Browse the repository at this point in the history
  • Loading branch information
taobataoma committed Mar 25, 2017
1 parent e1a6a3b commit 10ed5c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/articles/server/models/article.server.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ var ArticleSchema = new Schema({
user: {
type: Schema.ObjectId,
ref: 'User'
},
test: {
type: String,
default: 'def'
}
});

ArticleSchema.index({user: -1, created: -1});

mongoose.model('Article', ArticleSchema);

0 comments on commit 10ed5c9

Please sign in to comment.