Javier Ferreiro7559174
Posts: 0
Joined: Thu May 28, 2015 10:38 pm

Problems when performing curl operations with filter against Appery DDBB

Hi all
I am trying the following curl requests
curl -k -v -X GET -H "X-
Appery-Database-Id: 54133d17e4b055c018db7f29" -G --data-urlencode 'where={ "Month":"2015-05-01T00:00:00.000"}' https://api.appery.io/rest/1/db/colle... db_result.txt

On result.txt however I see that filter is not applying and all table entries are given as result, even the ones that do not match the filter

It is also happening if I try with other filters, for example
curl -k -v -X GET -H "X-
Appery-Database-Id: 54133d17e4b055c018db7f29" -G --data-urlencode 'where={"school_id": "2"}' https://api.appery.io/rest/1/db/colle... db_result.txt

I enclose a screenshot of the table I am trying to read
Thank you in advance
Javier Image

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Problems when performing curl operations with filter against Appery DDBB

Hi Javier -

Just tested, works for me as expected, try without keys "-k -v" before your curl main command like this:

pre
codecurl -X GET -H "X-Appery-Database-Id: 554e8XXXX4b023ceac198ebb" -G --data-urlencode 'where={"Type": "Menu"}' https://api.appery.io/rest/1/db/collections/new_events/code
/pre

Javier Ferreiro7559174
Posts: 0
Joined: Thu May 28, 2015 10:38 pm

Problems when performing curl operations with filter against Appery DDBB

Ilya
Sorry to insist, but have repeated the 2 queries I mentioned in my first post removing -k -v; and in both of them I receive the three records that are currently in the table (I should receive just 1 record for the first query and just 1 for the second query)
Thank you in advance!
Javier

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Problems when performing curl operations with filter against Appery DDBB

Checked this one more time with:

precode
curl -X GET -H "X-Appery-Database-Id: 554e8XXXX4b023ceac198ebb" -G --data-urlencode 'where={"school_id": "1"}' https://api.appery.io/rest/1/db/collections/Events

...
[{"id":"55690e60XXXXX4930d2834e6","Date":"2015-06-01 00:00:00.000","createdAt":"2015-05-30 01:12:00.298","_updatedAt":"2015-05-30 01:13:10.006","Details":"something","Type":"Menu","school_id":"1"}]/code/pre

Javier Ferreiro7559174
Posts: 0
Joined: Thu May 28, 2015 10:38 pm

Problems when performing curl operations with filter against Appery DDBB

Ilya

The problem still persist. I will explain you all the tests I've done based on your last response.

Since it works for you but not for me, I've just thought the problem could be:
-either the lenght of values inserted on column "Details"
-or the format I chose for column "Details"; since I defined it as string but used the following structure inside: [{},{}]

No matter which filter I enclude in the curl query, the filter do not apply but the whole list of registers are given as response; also a warning message is shown:

curl: (3) [globbing] unmatched close brace/bracket in column X

So I first created a new table (called ai2_events) from scratch with the same structure, three records and the same content on column "Details": [{},{}]. I send the query to the new table, but still getting back all records in the response, and also the warning.
Then I removed colum Details and created a new one with same name, but selecting Array as format. On curl response I do not get warning, but still all the records are received.

I finally created a new table (called ai3_events) with column "Details" format set to Array and with an empty value in all my three records.

Image

I run a new curl test, but still the same problem... !?

curl -X GET -H "X-Appery-Database-Id: 54133d17e4b055c018db7f29" -G --data-urlencode 'where={"school_id": "2"}' https://api.appery.io/rest/1/db/colle...

This request should retreive just one record, right? Well, it gets again the three of them :(

curl: (3) [globbing] unmatched close brace/bracket in column 2

[{"id":"55696d3ce4b0d4930d289bc2","Month":"2015-05-01 00:00:00.000","createdAt
":"2015-05-30 07:56:44.773","updatedAt":"2015-05-30 07:57:32.617","Type":"Menu"
,"school_id":"1"},{"id":"55696d72e4b0d4930d289bc4","Month":"2015-06-01 00:00:00
.000","createdAt":"2015-05-30 07:57:38.752","updatedAt":"2015-05-30 07:57:45.0
01","Type":"Menu","school_id":"1"},{"id":"55696d81e4b0d4930d289bc5","Month":"20
15-06-01 00:00:00.000","createdAt":"2015-05-30 07:57:53.045","_updatedAt":"2015
-05-30 07:57:59.880","Type":"Menu","school_id":"2"}]

Suggestions are welcome. Thank you in advance!
Javier

Javier Ferreiro7559174
Posts: 0
Joined: Thu May 28, 2015 10:38 pm

Problems when performing curl operations with filter against Appery DDBB

Hi again
Also tried creating a new database. Same result :(
Either I am missing something really stupid, or it looks like there is something weird in my account !?
BR
Javier

Javier Ferreiro7559174
Posts: 0
Joined: Thu May 28, 2015 10:38 pm

Problems when performing curl operations with filter against Appery DDBB

Found the problem. It looks like in Windows single quotes are not supported for curl requests

curl -k -X GET -H "X-Appery-Database-Id: 5569a903e4b0685c6b45ab13" -G --data-urlencode "where={\"school_id\"": \""1\""}"" a href=""https://api.appery.io/rest/1/db/collections/ai2-events"" rel=""nofollow""https://api.appery.io/rest/1/db/colle.../a

a href=""http://stackoverflow.com/questions/1756 ... and-braces"" rel=""nofollow""http://stackoverflow.com/questions/17.../a

Thanx for the help!
Javier"

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Problems when performing curl operations with filter against Appery DDBB

Hello Javier,

Thank you for the update!

Return to “Issues”