“需要由:: \“ path \”引起的mongot ::远程错误来自\“ wildcard \””-mongodb Atlas Search中的错误Java驱动程序

问题描述

当尝试使用mongodb Java驱动程序进行MongoDB Atlas Search 查询时,我得到了以下信息,而我正在使用Java驱动程序4.1。

exception in thread "main" com.mongodb.MongoCommandException: Command Failed with error 8 (UnkNownError): 'Remote error from mongot :: caused by :: "path" is required (from "wildcard")' on server ***. The full response is {"operationTime": {"$timestamp": {"t": 1603099324,"i": 1}},"ok": 0.0,"errmsg": "Remote error from mongot :: caused by :: \"path\" is required (from \"wildcard\")","code": 8,"codeName": "UnkNownError","$clusterTime": {"clusterTime": {"$timestamp": {"t": 1603099324,"signature": ***},"keyId": ***}}}
at com.mongodb.internal.connection.ProtocolHelper.getCommandFailureException(ProtocolHelper.java:175)
at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:359)
at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:280)
at com.mongodb.internal.connection.UsageTrackingInternalConnection.sendAndReceive(UsageTrackingInternalConnection.java:100)
at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.sendAndReceive(DefaultConnectionPool.java:490)
at com.mongodb.internal.connection.CommandProtocolImpl.execute(CommandProtocolImpl.java:71)

代码段之后,它是从mogodb Atlas控制台本身生成的。

testingCollection.aggregate(Arrays.asList(
    eq("$search",eq("wildcard",and(
                            eq("path","name"),eq("query","dushan*"),eq("allowAnalyzedField",true)
                       )
              )
      ))).first();

你知道是什么原因吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...