Wildanzr opened a new issue, #327:
URL: https://github.com/apache/couchdb-nano/issues/327
<!--- Provide a general summary of the issue in the Title above -->
I have a simple document like this:
```
{
"_id": "1679325987388-adm-tuDahr9PKY",
"_rev": "1-fd28138b2a26cbf379e051cec95eac71",
"username": "usernameofdoctor",
"password": "hashedpassword",
"hospitalId": "idofhospital",
"fullname": "fullnameofdoctor",
"isActive": true,
"createdAt": "2023-03-20T15:26:27.389Z",
"updatedAt": null,
"deletedAt": null,
"refreshToken": null,
"picture": "pictureofdoctor"
}
```
And the document design like this:
```
{
"_id": "_design/3d624e08b57448199f8384e190ab57fc59651eae",
"_rev": "1-1a00b9cb21f639016ea2d73b53970707",
"language": "query",
"views": {
"doctors_index": {
"map": {
"fields": {
"fullname": "asc",
"username": "asc",
"_id": "asc"
},
"partial_filter_selector": {}
},
"reduce": "_count",
"options": {
"def": {
"fields": [
"fullname",
"username",
"_id"
]
}
}
}
}
}
```
I want to implement rest api for this document with query included of page,
limit, and search. The search query will be refer to fullname property of
document. Then it will also sorting the result based of fullname in ascending.
But I always got this error
```
no matching index found, create an index to optimize query time
```
## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work
-->
I expected to got the result with sorted condition, but it always return
error message.
## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected
behavior -->
<!--- If suggesting a change/improvement, explain the difference from
current behavior -->
## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->
## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1. Create a db, add index to some property
2. add some data in db
3. Try find some document and sort using index property
## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful
in the real world -->
## Your Environment
<!--- Include as many relevant details about the environment you experienced
the bug in -->
* Version used:10.1.2
* Browser Name and version: Brave Browser 1.49.120
* Operating System and version (desktop or mobile): Ubuntu 22
* Link to your project:
https://github.com/Wildanzr/rscam-server/blob/feat01-management-doctor/src/doctors/doctors.service.ts#L113
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]