cost 170 ms
Spring Mongo - 连接到多个 Mongo DB 导致连接超时 - Spring Mongo - Connecting to Multiple Mongo DB's results in Connection Timeouts

我有一个让我难过的问题。 希望有人能在这里帮助我。 所以我很遗憾在 position 中有一个微服务,目前需要连接到 4 个 mongo 数据库,这些数据库都在云(Mongo Cloud Atlas)和同一个集群上运行。 在设置完所有内容并部署我的服务后,我每隔几个小时就会不断收到超时等错误。 各种 ...

Mongo java 驱动程序从 indexOfArray 添加字段值填充 - Mongo java driver add fields value population from indexOfArray

mongo java driver Aggregates 是否有任何方法来添加具有从数组运算符的索引解析的值的字段? 例子:: 学生 1:命名 A 级银学生 2:说出 Grade B Gold 学生 3:姓名等级:C 青铜查询是查询学生集合并按照学生成绩的特定值对其进行排序(不是简单的升序或降序 ...

Java 中的查找数组是否存在 memory 问题? - Is there a possible memory problem with lookup array in Java?

我正在试验 Java 和 MongoDB,并且正在进行查找聚合。 我注意到,当我执行查找时,返回的文档包含查找字段作为文档数组 - 作为java.util.ArrayList 。 所以我的问题是——如果我遇到这样一种情况,在我的查找数组中我将加载很多文档怎么办? 这可能是我的 java 堆 mem ...

Mongo Java:在一个命令中设置值并使用先前的值推送到数组 - Mongo Java: Set values and push to array with previous values in one command

我想在upsert期间将之前的 state(如果值发生变化)推送到数组history (atomar)中,但无论我尝试什么,我都找不到一个干净的解决方案。 您可以在下面找到简化的尝试: 尝试 1:使用$set和$concatArrays 问题: 当第一次执行upsert时(即插入),一个空的 obj ...

无效的@BsonCreator 构造函数。 预期 class java.lang.String,找到接口 java.util.List - Invalid @BsonCreator constructor. Expected class java.lang.String, found interface java.util.List

我正在尝试使用 POJO 将数据写入 MongoDB,但我似乎无法让它工作。 我有很多不同的数据结构,因为我要存储各种类型的图表数据。 让我们从错误开始: 这是我创建注册表的方式,当我 .build .build() PojoCodecProvider时出错: CodecRe ...

Mongo java 驱动程序从 3.12.1 升级到 4.2.3 抛出方法/类在部署时找不到异常 - Mongo java driver upgrade from 3.12.1 to 4.2.3 throwing method/class not found execptions on deployment

我有基于 mongo server 4.2 的 java 应用程序,组件版本如下 我将 spring 引导更新到 2.5.8,因此对更新依赖项进行了一些更改,如下所示 正如我使用新添加的 即使用 mongo-java 驱动程序 3.12.1 的现代 API 我更新到 mongodb-driver-s ...

Mongo change-Stream with Spring resumeAt vs startAfter 和在连接丢失的情况下容错 - Mongo change-Stream with Spring resumeAt vs startAfter and fault tolerance in case of connection loss

在 stackOverflow 上找不到答案,在任何文档中也找不到,我有以下更改 stream 代码(听数据库而不是特定集合) Mongo 版本是 4.2 我希望 stream 仅从系统启动时间开始侦听,而不在操作日志中采取任何措施, .resumeAt(Instant.now().minusSe ...

使用 mongodb java 驱动程序保证 mongodb 文档中的字段顺序 - guarantee fields order in a mongodb documents using mongodb java driver

使用 MongoDB 驱动程序 4.1.0(和 quarkus 1.1.1),我有一个具有复合_id的实体: (其中 a 实际上是一个 ObjectId 十六进制字符串) 保存实体后, _id字段按字母顺序保留: 稍后,使用pymongo在其他地方插入相同的逻辑实体: collection.upd ...

如何在 Micronaut 应用程序中使用 mongo java 驱动程序将实际查询记录到 MongoDB - How can I log actual queries to MongoDB with mongo java driver in Micronaut application

我正在如下设置 mongo 记录器 当我在 Micronuat 应用程序中使用 java 驱动程序运行查询时 但是,如果我复制此命令并尝试在 mongoshell 中运行,它将不起作用,我如何显示它生成的确切查询。 这样我就可以运行该查询并在控制台上看到 output ...

MongoDB 4.4、Java 驱动程序 4.2.3 - InsertManyResult.getInsertedIds() 不返回所有插入文档的 ID - MongoDB 4.4, Java driver 4.2.3 - InsertManyResult.getInsertedIds() not returning IDs for all inserted documents

成功InsertMany操作后,我试图检索插入文档的_id值。 为此,我正在使用InsertManyResult.getInsertedIds() 。 虽然这种方法在大多数情况下都有效,但在某些情况下并非所有_id值都被检索到。 我不确定我是否做错了什么,但我会假设InsertManyResult ...

Java - 使用 MongoDB 集合批量写入/更新 - Java - Insert/Update with MongoDB collection bulkWrite

我对 MongoDB 很陌生。 试图了解在 MongoDB 中执行批量写入的最佳选择。 我想定期刷新我的应用程序集合。 文档的键是 AppID、AppName 和 AppStatus。 以下是我想在每次运行中执行的操作 - 在 Application 集合中找到 AppID。 如果不存在,执行插入如 ...

什么是aws文档数据库中mongodb oplog的替代品来监听集合的变化? - What is replacement for mongodb oplog in aws document db to listen to changes in collection?

我们在代码中使用 oplog 集合(存在于本地数据库中)来检查事件是否在特定数据库上发生并在我们的代码中触发事件。但是,由于 aws 文档数据库不支持“https: //docs.aws.amazon.com/documentdb/latest/developerguide/developergu ...

MongoDB Java 驱动程序 4.2.2 - java.lang.noSuchMethodError when chaining.iterator or.into with.find - MongoDB Java Driver 4.2.2 - java.lang.noSuchMethodError when chaining .iterator or .into with .find

在完成 M220J 课程后,我正在尝试构建自己的应用程序和后端 API 以进一步了解 Mongo Java 驱动程序,但我遇到了一个障碍。 语境我正在使用 Mongo 驱动程序和 Spring 引导创建书签管理应用程序并在 Java 中重建后端。 使用 .iterator() 或 .into() ...

MongoDB Java 错误:流水线阶段规范 object 必须只包含一个字段 - MongoDB Java Error: A pipeline stage specification object must contain exactly one field

我试图在 java 上得到这个 MongoDB 查询的结果。 查询工作得很好,没有数据时它不显示任何内容。 但是,从 java 执行查询时会产生以下错误: com.mongodb.MongoCommandException: Command failed with error 40323 (Loca ...

如何从 MongoDB Java 中的多个嵌套文档中读取属性? - How to read attributes out of multiple nested documents in MongoDB Java?

我需要一些关于我计划做的项目的帮助。 在这个阶段,我正在尝试学习在 Java 中使用 NoSQL 数据库。 我有一些看起来像这样的嵌套文档: MongoDB 嵌套结构 就像你在图片上看到的那样,我的内在属性是“模型”和“构造”。 现在我需要遍历我的集合中的所有文档,它们的键名是未知的,因为它们是在 ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM