使用haskell驱动程序进行MongoDB全文搜索

时间:2013-07-18 17:08:58

标签: mongodb haskell mongodb-query

是否有可能使用haskell驱动程序对mongoDB进行全文搜索?

我在haskell API中找到了'runCommand',但是它需要一个Document作为参数。这对于mongodb可以运行的所有其他命令都没问题,但是文本命令的语法是:     db.collection.runCommand( "text", {search : "something"})

所以我不知道如何将“text”作为Document前面的第一个参数。

由于

1 个答案:

答案 0 :(得分:2)

text - 命令可以用另一种结构编写:

{ text: your_collection
, search: your_text
, filter: your_filter
, limit: your_limit
, project: your_projection
} 

我怀疑,因为所有“runCommand”-action都具有相同的结构。所以我尝试将该结构应用于text-command - 但没有成功。然后我记得aggregate也有另一个结构并尝试过,但这也没有用。最后,我在google group entry of the Java driver中找到了答案。

相关问题