.query() doesn't work on external collection

Hello everyone,
I try to search across the forum but I didn’t find what I’m looking for.

I have an external collection plugged on a AWS RDS MySQL database. Everything’s on green on my SQL Connector. When I query the schemas with CURL my connector I has the json response below :

{
            "id": "wix_reparations",
            "displayName": "wix_reparations",
            "allowedOperations": [
                "get",
                "find",
                "count",
                "update",
                "insert",
                "remove",
                "bulkRemove",
                "bulkInsert",
                "bulkUp

	]
	
	[...]
	"wrep_brand": {
                    "displayName": "wrep_brand",
                    "type": "text",
                    "queryOperators": [
                        "eq",
                        "ne",
                        "contains",
                        "startsWith",
                        "endsWith",
                        "hasSome",
                        "matches",
                        "gt",
                        "gte",
                        "lt",
                        "lte",
                        "urlized",
                        "isEmpty",
                        "isNotEmpty"
                    ]
                },

Everything sounds good for me on this part. Then I create a dummy page, with a repeater, a title and connect the title to the field ‘wrap_brand’. Everything’s works.

So why when I run :

import wixData from 'wix-data';

$w.onReady(function () {
wixData.query("wix_reparations")
  .eq("wrep_brand", "Apple")
  .find()
  .then((results) => {
    if(results.items.length > 0) {
      console.log(results.items[0]); //see firstItem below
    } else {
      console.log("NO ITEM FOUND")
    }
  })
  .catch((err) => {
    console.log(err);
  });
});

I have this output in my console :

Error: WDE0025: The wix_reparations collection does not exist. You cannot work with a collection using the Data API before it is created in the Editor.

Thanks a lot in advance for your help,

Julien

When you created the connection to Wix in the very last part of this tutorial, you should be able to see the content collection. From that error, it sounds like maybe that hasn’t been completed yet? Take a look https://support.wix.com/en/article/velo-integrate-your-aws-rds-database-with-your-wix-site

Hello @amandam
Thanks for your fast answer. Im able to see the content collection by the CURL Post, in the content manager in EditorX and on my website as a visitor.

So I don’t understand how I cannot perform a query with Velo…

Ah, unfortunately if everything is as expected you may need to reach out to customer care so they can see if you are experiencing a bug. You can do so at wix.com/contact

I would double check that the id in the content collection within the Wix site is exactly the same as what you are trying to query (just in case) as it’s not recognizing that id.

I triple checked :nerd_face:
Thanks for your help, im gonna contact them !

1 Like

Good luck and please let us know what the solution was if it’s not a bug!

1 Like

Done ! It will post here since I have the answer !