angular / in-memory-web-api

The code for this project has moved to the angular/angular repo. This repo is now archived.
MIT License
1.18k stars 232 forks source link

Is it possible to query by multiple columns of collection object? #203

Open rurziceanu opened 6 years ago

rurziceanu commented 6 years ago

Let's say we have a books collection and we want to filter by name OR author Is this possible? I cannot find how to do this in the docs..

api/books/?name=$searchTerm|author=$searchTerm

does not work.. if I do

api/books/?name=$searchTerm&author=$searchTerm

seems to work but it applies AND condition and I need a OR condition

bradhowes commented 5 years ago

I too was curious about changing search behavior. Looks like one place that needs customizing is in the applyQuery method, and perhaps in the parseRequestUrl and/or createQueryMap methods depending on how you will convey your query.