-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search for Data Contract Documents partially not working #2409
Comments
@owl352 |
command:
ORDER BY transactionIndex ASC
ORDER BY transactionIndex DESC
As result, we have the same resultsMatch status == 3 and order desc for transactionIndex
Match [['transactionIndex', 'in', [0,1,2,3,4,5]], ['status', '>=', 0]] and order [['status', 'desc'],['transactionIndex', 'desc']]
Match [['transactionIndex', 'in', [0,1,2,3,4,5]], ['status', '==', 3]] and order [['status', 'desc'],['transactionIndex', 'desc']]
Match [['transactionIndex', 'in', [0,1,2,3,4,5]], ['status', 'in', [0,1,2,3]]] and order [['status', 'desc'],['transactionIndex', 'desc']]
As result: order by works in desc only with match I also noticed that when using an empty match, order by asc and then cutting off the document via startAfter, we will get an empty array, while with startAt everything will work fine |
one line commands:
|
Hello! Our indexes work very similarly to other compound index implementations such as MongoDb or MySQL.
|
@shumkov Hm.. and how is this related to the fact that startAt works under any conditions, and startAfter returns an empty array with sorting enabled? I also didn't really understand how this is related to the fact that sorting in asc order works under almost any conditions, and in desc order only under strict equals, which I described at the very beginning of the issue? |
I've been trying for months to make it clear to you that it doesn't work at all as described, but for some reason you persistently ignore it, and I get the impression that none of my bug reports have been read all the way through. |
At the moment, any attempt to implement pagination on documents of the same withdrawals contract results in some crazy crutches and no normal sorting on documents by index. Is this how it should work? |
About startAt and startAfter. no sort startAt
{
"v0": {
"documents": {
"documents": [
"AAU/WmN6He4mqnFcQoBNqOGk0lQ2fRA5NeT1bgLt0jl7/2UOb6gicKPeEMeNobmLMssPiz1laS1UawlaaWjlKCMEAAMAAAGTDxhbYAAAAZMRW244AQAAAAAAAABgAQAAAAAAEVpFAAAAAAAEk+AAAAAAAAAAAQAAAAAAAAAAF6kUZP90nNjl3VyALTt3O28MuFHYlG2HAAAAAAAAAAM=",
"AAhUZgs62jkPwlQHtShlyJynPXDblwjFZt2XgcLBNOMkWyRggLpkNQaF/jAtPXkPW7I4y2GZINRiMMhE8HmUSiMEAAMAAAGSdIiUFgAAAZJ12XqmAQAAAAAAAAAMAQAAAAAAERGKAAAAHvdq8gAAAAAAAAAAAQAAAAAAAAAAGXapFMaaC9p9qq5IG+je+V5fNHodAKS0iKwAAAAAAAAAAw==",
"AAmt3Ck70+Q3v3JomoFQBvXSya6bch2UbCuh6qQ85Cot/GfIFdPFc0n4BYx1om8NoBBZFWaFOanM3Z5sK33PjIcEAAMAAAGTTeustAAAAZNN+fJMAQAAAAAAAACNAQAAAAAAEXZKAAAAAAAEk+AAAAAAAAAAAQAAAAAAAAAAF6kUq+vrzeDjUm8Z6lxS7vzYHcCLNoaHAAAAAAAAAAM=",
"AAsrj55k5WtyEVNWs2jePBpv+Z7C4Gb0DBvaUd0m6AVEhHUz3wc18cwBXRt/xD8Sx1RMihHvEEI6e+en1JJP9H8EAAMAAAGTH7/ehgAAAZMgVq5kAQAAAAAAAABpAQAAAAAAEWEjAAABAB0b+AAAAAAAAAAAAQAAAAAAAAAAGXapFPcXqd2G6vCLk+kvrFJuQwpIm0OziKwAAAAAAAAAAw==",
"AA6XY18E3Wjfc3eisk53zjhYgU0nInDO29Gl6En0sL1a/GfIFdPFc0n4BYx1om8NoBBZFWaFOanM3Z5sK33PjIcEAAMAAAGTTfcgGQAAAZNN+fJMAQAAAAAAAACXAQAAAAAAEXZKAAAAAAAEk+AAAAAAAAAAAQAAAAAAAAAAF6kU6f8VZObepIjyuzPx+1ut8ItE9muHAAAAAAAAAAM="
]
},
"metadata": {
"height": "108061",
"coreChainLockedHeight": 1204629,
"epoch": 5389,
"timeMs": "1740755545513",
"protocolVersion": 8,
"chainId": "dash-testnet-51"
}
}
} documents ids:
startAfter
{
"v0": {
"documents": {
"documents": [
"AAhUZgs62jkPwlQHtShlyJynPXDblwjFZt2XgcLBNOMkWyRggLpkNQaF/jAtPXkPW7I4y2GZ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"1740755545513",
"protocolVersion": 8,
"chainId": "dash-testnet-51"
}
}
} documents ids:
sortBy transactionIndex asc startAt
{
"v0": {
"documents": {
"documents": [
"AAU/WmN6He4mqnFcQoBNqOGk0lQ2fRA5NeT1bgLt0jl7/2UOb6gicKPeEMeNobmLMssPiz1laS1UawlaaWjlKCMEAAMAAAGTDxhbYAAAAZMRW244AQAAAAAAAABgAQAAAAAAEVpFAAAAAAAEk+AAAAAAAAAAAQAAAAAAAAAAF6kUZP90nNjl3VyALTt3O28MuFHYlG2HAAAAAAAAAAM=",
"AB7lPInUZK6WeNBrCXuNkBIT5WmtYHhEe73gn3FvJf1I/2UOb6gicKPeEMeNobmLMssPiz1laS1UawlaaWjlKCMEAAMAAAGTFRAGXAAAAZMWcAIgAQAAAAAAAABhAQAAAAAAEVyWAAAAAAAEk+AAAAAAAAAAAQAAAAAAAAAAGXapFJRaGiEgxW9c900g7WKNtbUPckg0iKwAAAAAAAAAAw==",
"APS6mSZU0zJ1YFJE9WPBTyhhwxUmbyi90yh9M2YswZ6u/2UOb6gicKPeEMeNobmLMssPiz1laS1UawlaaWjlKCMEAAMAAAGTFRAtugAAAZMWcAIgAQAAAAAAAABiAQAAAAAAEVyWAAAAAAAEk+AAAAAAAAAAAQAAAAAAAAAAGXapFKSY6b2poVVY9Wjw/neTNqIV7jmBiKwAAAAAAAAAAw==",
"AG+0FTLxmEpGaRQ3/FbDIJvcZh353NU5G64YQ44Hr9lb/2UOb6gicKPeEMeNobmLMssPiz1laS1UawlaaWjlKCMEAAMAAAGTFRB7AwAAAZMWcAIgAQAAAAAAAABjAQAAAAAAEVyWAAAAAAAEk+AAAAAAAAAAAQAAAAAAAAAAF6kUHx8fwPPz1uXY2hB9lBQJy+Geu9CHAAAAAAAAAAM=",
"AK9jjYDxu72f00p6QEG2Fvo3rfvfDwtsb9QXeMa9pr/p/2UOb6gicKPeEMeNobmLMssPiz1laS1UawlaaWjlKCMEAAMAAAGTFRCiYAAAAZMWcAIgAQAAAAAAAABkAQAAAAAAEVyWAAAAAAAEk+AAAAAAAAAAAQAAAAAAAAAAGXapFAcnARxlhYAmDE4YqShTspSbeQ9KiKwAAAAAAAAAAw=="
]
},
"metadata": {
"height": "108061",
"coreChainLockedHeight": 1204629,
"epoch": 5389,
"timeMs": "1740755545513",
"protocolVersion": 8,
"chainId": "dash-testnet-51"
}
}
} documents ids:
sortBy transactionIndex asc startAfter
{
"v0": {
"documents": {},
"metadata": {
"height": "108062",
"coreChainLockedHeight": 1204631,
"epoch": 5389,
"timeMs": "1740755726772",
"protocolVersion": 8,
"chainId": "dash-testnet-51"
}
}
} And that's still correct behavior? |
The first one is not working as intended. It should work, I will look into why it isn't. |
When trying to retrieve documents for contract date withdrawals with where, I get an empty array, also sort works only in
asc
order,desc
not workingExpected Behavior
If I specify
['transactionIndex', '==', 2]
or['transactionIndex', '>=', 2]
or['transactionIndex', '>', 2]
, then I should get an array with documents whose index matches the condition in the responseCurrent Behavior
At any specified value for transactionIndex, I get an empty array in response. Also, if you specify another condition for
status
as a range, the search will also return an empty array. However, if at least one condition requires a strict comparison, everything will workPossible Solution
Steps to Reproduce (for bugs)
Context
Your Environment
The text was updated successfully, but these errors were encountered: