Skip to content

Commit

Permalink
Merge pull request #39 from asantarissy/search-repo-name
Browse files Browse the repository at this point in the history
Search by repo name
  • Loading branch information
asantarissy committed Nov 28, 2019
2 parents 17e07b7 + aacf4a7 commit 8abd3ce
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions api/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,20 @@ export const User = mongoose.model('User', {
seenWelcomeModal: Boolean,
});

export const Post = mongoose.model('Post', {
content: { type: String, text: true },
const PostSchema = new mongoose.Schema({
content: String,
userId: { type: String, index: true },
repository: { type: String, index: true },
calendarLink: { type: String },
repository: String,
calendarLink: String,
created_at: {
type: Date,
default: Date.now,
},
updated_at: Date,
});
}).index({ content: 'text', repository: 'text' });

export const Post = mongoose.model('Post', PostSchema);
Post.syncIndexes();

export const Comment = mongoose.model('Comment', {
content: String,
Expand Down

0 comments on commit 8abd3ce

Please sign in to comment.