2
votes

I'm using a Dojo memory store (dojo/store/Memory). I would like to retrieve items based on a wildcard query but the query method doesn't seem to support wildcards. i.e. given the following items:

{ id: "apple", details: "fruit" }
{ id: "applemac", details: "computer" }

store.query({ id: "apple" }) returns the first row as expected, but store.query({ id: "apple*" }) returns nothing.

Does anyone know if it's possible to use wildcards and if so, how?

Thanks

1

1 Answers

5
votes

You can use a RegExp object to do wildcard queries

store.query({id:new RegExp("apple*")})

Here's a JSFiddle