Skip to content

Commit 48d325f

Browse files
committed
created snippit schema
1 parent a543d16 commit 48d325f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

lib/models/snippit.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
3+
var mongoose = require('mongoose'),
4+
Schema = mongoose.Schema,
5+
textSearch = require('mongoose-text-search');
6+
7+
8+
/**
9+
* Snippit Schema
10+
*/
11+
var SnippitSchema = new Schema({
12+
snippit: String,
13+
method: String,
14+
startIndex: Number,
15+
endIndex: Number,
16+
github_id: {},
17+
score: Number
18+
});
19+
20+
SnippitSchema.plugin(textSearch);
21+
22+
SnippitSchema.index ( {contents: 'text' } );
23+
24+
mongoose.model('Snippit', SnippitSchema);

0 commit comments

Comments
 (0)