0

Here is the JavaScript code to create my Breeze query:

var query = new breeze.EntityQuery().from("suppliers").
            where("Name", op.Contains, "&").
            select("Name").
            orderBy("Name").
            take(50);

When I send this query, I receive this error: "The query specified in the URI is not valid."

In Fiddler I can see the URI, but it seems to be ok: http://localhost:59994/breeze/FastSearch/suppliers?$filter=substringof(%27%26%27%2CName)%20eq%20true&$orderby=Name&$top=50&$select=Name

I receive this error alway when my search pattern contains a '&' character.

Any idea how to fix that?

Jer
  • 383
  • 3
  • 17

1 Answers1

0

Try percent-encoding the ampersand:

where("Name", op.Contains, "%26")

See this answer: escaping ampersand in url

Community
  • 1
  • 1
Jonathan
  • 245
  • 1
  • 8
  • As you can see in my question, the ampersand was already escaped in the uri: ...$filter=substringof(%27%26%27%2CName)... – Jer Mar 03 '16 at 16:58