wirecardBrasil / moip-sdk-node

Módulo Node.js para integração com API Moip v2
MIT License
58 stars 14 forks source link

Query and Filters #27

Closed lfernando-silva closed 6 years ago

lfernando-silva commented 6 years ago

How can I query at the order request as documented in docs? I need to get an list of orders in an interval. I saw no query param at SDK docs neither in the code.

When I try use the orders.getAll() method, only returns the last 20 orders, even though I have more than hundred.

How can I make this query?

somentelucas commented 6 years ago

Hi @lfernando-silva, the filters are not implemented yet, unfortunately you won't be able to query all the orders in this version of the SDK yet. If you'd like to contribute to the implementation of this feature we would be happy to have a pull request raised from you! ❤️

lfernando-silva commented 6 years ago

Just to inform, I realized in fact is POSSIBLE to make a query, as the param _id is passed as string. So,

moip.order.getOne('?limit=100&filters=createdAt::bt(2017-10-10T13:07:00Z,2017-10-25T13:08:00Z')

totally works! But of course, would have an sugar syntax, as an object passed as querystring. Im working on it ;)

somentelucas commented 6 years ago

Oh, that's good to know @lfernando-silva, I hadn't realized this! But indeed would rather have a better syntax passing along an object, so I won't document it just yet. Also many thanks for the help! 😃