[JAVA-670] Sort.Direction.DESC from enum is value 1 instead of -1 Created: 19/Oct/12  Updated: 30/Nov/12  Resolved: 30/Nov/12

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: 2.9.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Jari Rangell Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows, Ubuntu



 Description   

query.with(new Sort(Sort.Direction.DESC, "fieldxxx"));
In Mongo the value of desc should be -1 instead of 1 that is coming from enum.



 Comments   
Comment by Philipp Schneider [ 28/Nov/12 ]

This is not related to the mongodb java driver.
Your issue (which is solved because of Deprecated) is because of spring data mongo.
Please see here: https://jira.springsource.org/browse/DATAMONGO

Comment by Jari Rangell [ 20/Oct/12 ]

The old sort is in org.springframework.data.mongodb.core.query and is deprecated.
See: @Deprecated
public org.springframework.data.mongodb.core.query.Sort sort() {
Also the ENUM for old direction is at org.springframework.data.mongodb.core.query

The new Sort is in package org.springframework.data.domain and

Comment by Jeffrey Yemin [ 19/Oct/12 ]

What package is this Sort class in? The Java driver doesn't have a class of that name.

Generated at Thu Feb 08 08:52:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.