spring-data-mongodb

Cannot create namespace in multi-document transaction(MongoDB 4.0, Spring Data 2.1.0, Spring Boot)

Deadly 提交于 2021-01-20 07:20:20
问题 This question regarding to Spring boot, Mongo4.0, Spring-data application. I have upgraded from MongoDB 3.6.x to MongoDB 4.0 and Spring data 2.0.x to Spring-data 2.1.0 for transactional management while inserting data into multiple documents. But here I face this issue while creating a database, collection and inserting a document into the collection. Issue Cannot create namespace sampledb_200.demo in multi-document transaction Here sampldb_200 is database name and demo is the collection name

Keyset(Seek) Pagination in Spring Data MongoDB

南笙酒味 提交于 2020-12-13 03:57:45
问题 Currently I'm trying to implement keyset, aka. seek pagination for Spring Data MongoDB. Currently I'm trying to go about this by using the information provided here. Unfortunately, this is a low-level implementation, and I was hoping to get some sort of abstraction similar to JOOQ, as they don't seem to support MongoDB. Is there any abstractions/easy ways out there that would allow me to accomplish this task, or is this something I would need to implement on a low-level on my own? 回答1: If you

Keyset(Seek) Pagination in Spring Data MongoDB

大憨熊 提交于 2020-12-13 03:57:32
问题 Currently I'm trying to implement keyset, aka. seek pagination for Spring Data MongoDB. Currently I'm trying to go about this by using the information provided here. Unfortunately, this is a low-level implementation, and I was hoping to get some sort of abstraction similar to JOOQ, as they don't seem to support MongoDB. Is there any abstractions/easy ways out there that would allow me to accomplish this task, or is this something I would need to implement on a low-level on my own? 回答1: If you

MongoRepository query for between dates

断了今生、忘了曾经 提交于 2020-12-08 06:28:14
问题 My pojo public class PacketData implements Serializable { private static final long serialVersionUID = 1L; @Id private final String token = UUID.randomUUID().toString(); private final ZonedDateTime arrived = ZonedDateTime.now(); } I plan to use like following. @Query("?") List<PacketData> findPacketArrivedBetween(ZonedDateTime startDate, ZonedDateTime endDate); Is there a way i can put the following query to the above query annotation and how i can do greater than and less than logic Query

MongoRepository query for between dates

怎甘沉沦 提交于 2020-12-08 06:28:08
问题 My pojo public class PacketData implements Serializable { private static final long serialVersionUID = 1L; @Id private final String token = UUID.randomUUID().toString(); private final ZonedDateTime arrived = ZonedDateTime.now(); } I plan to use like following. @Query("?") List<PacketData> findPacketArrivedBetween(ZonedDateTime startDate, ZonedDateTime endDate); Is there a way i can put the following query to the above query annotation and how i can do greater than and less than logic Query

Couldn't find PersistentEntity for type class when using @EnableMongoAuditing

旧时模样 提交于 2020-12-05 05:44:44
问题 I am getting " Couldn't find PersistentEntity for type class " error when I am using @EnableMongoAuditing features along with MongoRepository. This happens when I save a document when collection isn't already present in database. I tried whatever is mentioned in: https://github.com/spring-projects/spring-boot/issues/12023 https://jira.spring.io/browse/DATAMONGO-1999 Spring boot mongodb auditing error but nothing is working. Mentioned things are: Extend MongoConfig by

Couldn't find PersistentEntity for type class when using @EnableMongoAuditing

爷,独闯天下 提交于 2020-12-05 05:43:27
问题 I am getting " Couldn't find PersistentEntity for type class " error when I am using @EnableMongoAuditing features along with MongoRepository. This happens when I save a document when collection isn't already present in database. I tried whatever is mentioned in: https://github.com/spring-projects/spring-boot/issues/12023 https://jira.spring.io/browse/DATAMONGO-1999 Spring boot mongodb auditing error but nothing is working. Mentioned things are: Extend MongoConfig by