Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Correct syntax for database request

I changed the method on your advice 7 days ago!!!

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

Correct syntax for database request

Joe,

i beg your pardon, it was my mistake. We corrected your project, now everything works correctly except this bug, we are working on it at the moment.

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Correct syntax for database request

Hi Evgene, No problems let me know when you have sorted the bug out.

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Correct syntax for database request

Do you have any idea when this bug will be sorted?

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

Correct syntax for database request

Hello Joe,
Try you query one more time.
Add "$date" before actual date value
ex: {"_createdAt:{"$gte":{"$date": "2014-12-30T05:01:45.973Z"}}}

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Correct syntax for database request

Hi Egor,
I have attempted the query with the amended parameter which gives the same empty response. The generated where clause now looks like.

where:{"_createdAt":{"$gte":{"$date": "Thu Mar 05 2015 14:25:57 GMT+0000 (GMT Standard Time)"}}}

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Correct syntax for database request

Hi Joe,

Nope you have incorrect Date value.

Here is a correct example of JS code for "where" request parameter:

pre

var dateObject = new Date();
var whereObject = {"_createdAt": {$gt: {"$date": dateObject.toISOString()} } };
return JSON.stringify(whereObject);

/pre

Regards.

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Correct syntax for database request

Hi Yuri,

Of course well done thank you for spotting that, everything is now working as expected.

Regards,
Joe

Return to “Issues”