parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Diffrent result using REST API 'api.parse.com' and 'Local parse server'

Open slickker opened this issue 10 years ago • 5 comments

I try to migrate my local server. Migration was success. But I have a problem while use REST API and same parameter.

These are parameters. include:companyId.logo limit:100 order:-createdAt where:{"createdAt":{"$gte":"2016-02-17T15:00:00.000Z"},"visible":{"$ne":false}}

This is url for api.parse.com. https://api.parse.com/1/classes/Job?include=companyId.logo&limit=100&order=-createdAt&where=%7B%22createdAt%22%3A%7B%22%24gte%22%3A%222016-02-17T15%3A00%3A00.000Z%22%7D%2C%22visible%22%3A%7B%22%24ne%22%3Afalse%7D%7D

This is url for local server. http://www.easyk.co.kr/parse/classes/Job?include=companyId.logo&limit=100&order=-createdAt&where=%7B%22createdAt%22%3A%7B%22%24gte%22%3A%222016-02-17T15%3A00%3A00.000Z%22%7D%2C%22visible%22%3A%7B%22%24ne%22%3Afalse%7D%7D

Response is OK. But results are not same.

Another case, results are same.

These are parameters. include:companyId.logo limit:200 order:-createdAt where:{"expired_at":{"$gte":{"__type":"Date","iso":"2016-02-17T15:00:00.000Z"}},"visible":{"$ne":false}}

This is url for api.parse.com. https://api.parse.com/1/classes/Job?include=companyId.logo&limit=200&order=-createdAt&where=%7B%22expired_at%22%3A%7B%22%24gte%22%3A%7B%22__type%22%3A%22Date%22%2C%22iso%22%3A%222016-02-17T15%3A00%3A00.000Z%22%7D%7D%2C%22visible%22%3A%7B%22%24ne%22%3Afalse%7D%7D

This is url for local server. http://www.easyk.co.kr/parse/classes/Job?include=companyId.logo&limit=200&order=-createdAt&where=%7B%22expired_at%22%3A%7B%22%24gte%22%3A%7B%22__type%22%3A%22Date%22%2C%22iso%22%3A%222016-02-17T15%3A00%3A00.000Z%22%7D%7D%2C%22visible%22%3A%7B%22%24ne%22%3Afalse%7D%7D

These results are same.

Why not same upper case? I don't know.. Parse server not fully support REST API?

Thanks,

p.s I try change to Parse Javascript SDK. This way is OK. I think that 'createdAt' has problem using REST API.

slickker avatar Feb 19 '16 06:02 slickker

Can you put the actual output in a gist or a text file and attach it here, since we can't quite see the difference based on URLs, since the api keys/app ids are not specified.

nlutsenko avatar Feb 26 '16 10:02 nlutsenko

It doesn't look like the URLs are different, so lets not focus there... If you're still having an issue with the latest version, please open a new issue and describe the differences in the results. Thanks.

gfosco avatar Mar 06 '16 10:03 gfosco

Hi , Issue is there for me too. See the attachments . Obviously there is an entry after date 2017-01-02T04:58:01.157Z , greater than query returns nothing . Please help.

screenshot 2017-02-02 11 15 51 screenshot 2017-02-02 11 15 38

shebinhere avatar Feb 02 '17 07:02 shebinhere

@shebinceino Hi, I have a solution for this problem. I changed query below. {"createdAt":{"$gte":today},"visible":{"$ne":false}} -> {"createdAt":{"$gte":{"__type":"Date", "iso":today}},"visible":{"$ne":false}} I hope it helps ^^

slickker avatar Feb 02 '17 07:02 slickker

Thanks. Its working

shebinhere avatar Feb 02 '17 10:02 shebinhere