platform icon indicating copy to clipboard operation
platform copied to clipboard

Retrieve documents with where query syntax throws InvalidRequestError

Open mayoreee opened this issue 2 years ago • 3 comments

Retrieve documents with where query syntax throws InvalidRequestError

Expected Behavior

Successfully retrieve documents

Current Behavior

Something went wrong:
 InvalidRequestError: Invalid query: Properties in where conditions must be defined as a document index

Steps to Reproduce (for bugs)

Contract's Indices:

"indices": [
      {
        "name": "index",
        "properties": [
          {
            "$ownerId": "asc"
          },
          {
            "$updatedAt": "asc"
          }
        ],
        "unique": false
      }
    ],

Query syntax:

           {
                limit: 1, // Only retrieve 1 document
                where: [
                    ['$ownerId', '==', params.ownerId],
                    ['$updatedAt', '==', params.updatedAt]
                ]
            },

Your Environment

  • Version used: dash v3.22.1

mayoreee avatar Apr 12 '22 09:04 mayoreee

~Looks similar to #315 so the suggestion in https://github.com/dashevo/platform/issues/315#issuecomment-1085614223 will probably help.~ <- Disregard this, I read too quickly :see_no_evil:

thephez avatar Apr 12 '22 12:04 thephez

@mayoreee can you provide link to Github with the complete query - as per todays Triage, this is likely a duplicate of https://github.com/dashevo/platform/issues/315

Further detail required to verify if user error or documentation update required.

SamKirby22 avatar Apr 22 '22 07:04 SamKirby22

@SamKirby22 Not sure about the query you're referring to but the query syntax has been provided in the report above. Could you please help clarify? Thanks.

mayoreee avatar Apr 22 '22 08:04 mayoreee

This is outdated.

shumkov avatar Sep 26 '24 11:09 shumkov