Skip to content

QuerydslAbstractMongodbQuery lacks a toJson method [DATAMONGO-2327] #3183

@spring-projects-issues

Description

@spring-projects-issues

Marc Tarin opened DATAMONGO-2327 and commented

Hello.

Starting with Spring Data MongoDB 2.1.9 (Spring Boot 2.1), SpringDataMongodbQuery inherits its where() method from QuerydslAbstractMongodbQuery instead of AbstractMongodbQuery.

QuerydslAbstractMongodbQuery favors org.bson.Document over com.mongodb.DBObject

Therefore, while AbstractMongodbQuery$toString() provides a parseable JSON string of a queryDSL Predicate (using DBObject$toString()),  QuerydslAbstractMongodbQuery$toString() does not, as it uses Document.toString().

 

For use cases similar to the example in the referred URL, QuerydslAbstractMongodbQuery could benefit having a toJson() method that internally uses Document$toJson()


Affects: 2.1.9 (Lovelace SR9)

Reference URL: https://stackoverflow.com/a/48824169/5873923

Referenced from: pull request #774

Metadata

Metadata

Labels

in: mappingMapping and conversion infrastructuretype: enhancementA general enhancement

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions