Skip to content

Commit 49dbde5

Browse files
committed
fixed issue with search projection meta
1 parent 7475976 commit 49dbde5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

models/Users.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ var Schema = db.Schema(schemaObject);
5959
// Schema.index({'tags': 'text'});
6060

6161
Schema.statics.search = function(string) {
62-
return this.find({$text: {$search: string}}, { score : { $meta: "textScore" } })
63-
.sort({ score : { $meta : 'textScore' } });
62+
return this.find({$text: {$search: string}});
6463
};
6564

6665
// assign a function to the "methods" object of our Schema

0 commit comments

Comments
 (0)