ViewOrdering parameter is not working

Description

In SDK 3 up to and including 3.1.0, the ViewOrdering parameter is not working. An order value of ViewOrdering.Descending is ignored and the results are returned in ascending order.
Also, if you set order to Descending, and a range with start set to the high key and end set to the low key, you get an error:
‘No rows can match your key range, reverse your start_key and end_key or set descending=true’

I’ve just looked at the SDK source and can see the reason for this. In viewexecutor.js it says:

 

{{ if (options.order > 0) {
queryOpts.descending = false;
} else if (options.order < 0) {
queryOpts.descending = true;
}}}

This should be “if (options.order === ViewOrdering.Ascending)…”. If I pass a value of -1 to order it works.

Environment

None

Gerrit Reviews

None

Release Notes Description

None

Activity

Show:
Matt Ingenthron
updated the WorkflowDecember 22, 2022 at 6:45 AM
Couchbase SDK Workflow
Couchbase SDK Workflow with Review
Brett Lawson
changed the StatusJanuary 12, 2021 at 10:41 PM
Open
Resolved
Brett Lawson
updated the ResolutionJanuary 12, 2021 at 10:41 PM
None
Fixed
Brett Lawson
updated the Fix versionsJanuary 12, 2021 at 10:41 PM
3.1.2
None
Brett Lawson
updated the Fix versionsJanuary 12, 2021 at 10:41 PM
None
3.1.1
Brett Lawson
updated the Fix versionsDecember 4, 2020 at 8:03 PM
None
3.1.1
Brett Lawson
changed the StatusDecember 4, 2020 at 8:03 PM
New
Open
Arun Vijayraghavan
created the IssueDecember 4, 2020 at 7:53 PM
Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Components

Fix versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created December 4, 2020 at 7:53 PM
Updated January 12, 2021 at 10:41 PM
Resolved January 12, 2021 at 10:41 PM
Instabug