我在haskell API中找到了'runCommand',但它期望一个可以使用mongoDB的全文搜索的haskell驱动程序。文档作为参数。对于mongodb可以运行的所有其他命令来说,这很好,但是文本命令的语法是: db.collection.runCommand(text,{search:something})
所以我不知道如何将文本作为文档前面的第一个参数。
谢谢解决方案
文本 -command可以用另一种结构编写:
{text:your_collection ,搜索:your_text ,过滤器:your_filter ,限制:your_limit ,项目:your_projection }我有我的怀疑,因为所有runCommand-action都具有相同的结构。所以我试图将这种结构应用于文本命令 - 但没有成功。然后我记得 aggregate 也有另外一个结构,并且尝试过,但那也不起作用。最后,我在Java驱动程序的 Google小组条目中找到答案。
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
解决方案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.
更多推荐
使用haskell驱动程序进行MongoDB全文搜索
发布评论