-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
status: waiting-for-triageAn issue we've not yet triagedAn issue we've not yet triaged
Description
Using spring-data-mongodb:3.4.0.
Running a custom query using the @Query annotation in my repository class. Full method looks like.
@Query(value="{'firstName': ?0, 'lastName': ?1}")
Page<Customer> searchCustomers(String firstName, String lastName, Pageable pageable);
When enabling debug logging for the MongoTemplate class, the logs output the following.
find using query: { "firstName" : "Josh", "lastName" : "Smith"} fields: Document{{}} sort: { "firstName" : "Josh", "lastName" : "Smith"} for class: class com.examples.mongobank.models.Customer in collection: customers
This method returns correctly, which proves that the logging statement is erroneous as if you tried to run this directly against the DB you would get this error.
Enterprise replLocal [direct: primary] mongobank> db.customers.find({ "firstName" : "Josh", "lastName" : "Smith"}).sort({"firstName":"Josh", "lastName":"Smith"});
MongoInvalidArgumentError: Invalid sort direction: "Josh"
Enterprise replLocal [direct: primary] mongobank>
This creates a problem when trying to triage issues with queries, because we can't trust that the logger is outputting the correct query.
Metadata
Metadata
Assignees
Labels
status: waiting-for-triageAn issue we've not yet triagedAn issue we've not yet triaged