Created
June 19, 2013 12:21
-
-
Save SachaG/5813870 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.methods({ | |
searchPosts: function(term) { | |
console.log('-- searching for "'+term+'" --') | |
Future = Npm.require('fibers/future'); | |
var fut = new Future(); | |
Meteor._RemoteCollectionDriver.mongo.db.executeDbCommand({ | |
"text": "posts", | |
search: term | |
}, function (error,results){ | |
if (results && results.documents[0].ok === 1){ | |
fut.ret(results); | |
} | |
}); | |
return fut.wait(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment