Reputation: 63
Is there a possibility to use the full text search of mongoDB with the haskell driver?
I found the 'runCommand' in the haskell API, but it expects a Document as parameter. That's fine for all the other commands that mongodb can run, but the syntax for a text command is:
db.collection.runCommand( "text", {search : "something"})
So I don't know how I'll get the "text" as first parameter in front of the Document.
Thanks
Upvotes: 2
Views: 156
Reputation: 1500
The text
-command can be written in another structure:
{ text: your_collection
, search: your_text
, filter: your_filter
, limit: your_limit
, project: your_projection
}
I had my suspicion, since all "runCommand"-action have the same structure. So I tried to apply that structure to the text-command - but without success. Then I remembered that aggregate
has another structure too and tried that, but that didn't work either. Finally, I found the answer in a google group entry of the Java driver.
Upvotes: 2