I have a collection that contains all orders from multiple users and now I want to return all orders that belongs to that specific user, how do I do that? If I were to get all orders and filter it in client side, it’s not very efficient. Is there a more efficient way of doing it?
I think you can customize your “find” query in such way that it automatically returns all the orders from that specific user by his ID. Check out this section in the docs:
Hope it helps!
Can you not use GraphQL rather than REST and filter your query to return just the selected user’s orders?
I’ve never configured graphQL in my project which was why I never use it but if you can do in GraphQL, can’t you also do it in REST?
You certainly can, but as Michael suggests, you’ll have to roll your own services. GraphQL should be able to do this for you straight out of the box.