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

编程入门 行业动态 更新时间:2024-10-27 22:29:14
本文介绍了使用haskell驱动程序进行MongoDB全文搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在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全文搜索

本文发布于:2023-11-22 12:53:51,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:驱动程序   全文   haskell   MongoDB

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!