shiki / kaiseki

A Parse.com REST API Client for Node.js
MIT License
223 stars 43 forks source link

How do I query for a month? #25

Closed martinsookael closed 9 years ago

martinsookael commented 9 years ago

I'm trying to query posts from one specific month. Current not working version:

var params = { where: { userId: userId, dated: { $gte: startDate, $lte: endDate } }, order: 'dated' } kaiseki.getObjects('Posts', params, function(err, response, body, success) { // .... });

How do I achieve this in kaiseki?

shiki commented 9 years ago

@martinsookael Try doing it like this:

var params = {
  where: {
    'dated': {
      '$gte': { '__type': 'Date', 'iso': '2011-08-21T18:02:52.249Z'}
    }
  }
}

You can read more about Data Types here: https://parse.com/docs/rest#objects-types

martinsookael commented 9 years ago

Thank you so much!