MongoDB full text search with haskell driver

陌路散爱 提交于 2019-12-11 02:58:18

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/17729863/mongodb-full-text-search-with-haskell-driver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!