prooph / event-store-http-api

Prooph EventStore HTTP API
http://getprooph.org/
BSD 3-Clause "New" or "Revised" License
18 stars 3 forks source link

Allow filtering by metadata #14

Closed codeliner closed 7 years ago

codeliner commented 7 years ago

How do we want to design the filter capabilities?

We can load and loadReverse with an optional MetadataMatcher but how do we expose those filters in the http-api?

Two options:

1) Using query params in the format: ?meta_1_field=_aggregate_id&meta_1_operator=eq&meta_1_value=abcd-efgt-ijklmnop&meta_2_field=_aggregate_version&meta_2_operator=gte&meta_2_value=10

We could also shorten the params so that meta_1_field becomes m_1_f for examle And meta_<no>_operator could be optional and default to eq This would save a lot of characters because the length of an URI is somewhat limited.

2) Use POST and send filters as JSON in the request body.

codeliner commented 7 years ago

Also related to https://github.com/prooph/event-store/issues/284

If we decide for option 1, I'd suggest prop_<no>_<field|operator|value> or p_<no>_<f|o|v>

prolic commented 7 years ago

I would say let's use post and json for this.

codeliner commented 7 years ago

Problem with POST: