Skip to content

Queries in MongoTemplate Logs with ObjectId Format. #4873

Open
@ganeshbabugb

Description

@ganeshbabugb

When any operations made through MongoTemplate, I set the log level to DEBUG using the following configuration:
logging.level.org.springframework.data.mongodb.core.MongoTemplate=DEBUG.

This allows me to view the queries executed by MongoTemplate, which is helpful. However, the issue is that the query logs display ObjectId in the oid format, which cannot be directly executed in the MongoDB Compass client.

Is there a way to log the queries in the ObjectId("") format instead? I couldn’t find a solution for this issue. If a solution already exists, please let me know. If not, it would be great to have this functionality implemented.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions