confused about date parsing

2014-01-29 Thread Dan Santner
My docs look something like this: { _id: 52e131783eb7a3.66772120, _rev: 3-a734cbeb70ed87d5e84cd04c269149da, billing: { plan: trial, trialDays: 14, trialEndDate: 2014-02-06 15:14:37, nextDate: , stripeId: , cardId: , last4: ,

Re: confused about date parsing

2014-01-29 Thread Alexander Shorin
On Thu, Jan 30, 2014 at 2:13 AM, Dan Santner dansant...@me.com wrote: var today = new Date(); This value will be computed only once when document get indexed, not each time when you query the view. You need to make key as outDoc.expiryAge and pass current date

Re: confused about date parsing

2014-01-29 Thread Jens Alfke
On Jan 29, 2014, at 2:17 PM, Alexander Shorin kxe...@gmail.com wrote: On Thu, Jan 30, 2014 at 2:13 AM, Dan Santner dansant...@me.com wrote: var today = new Date(); This value will be computed only once when document get indexed, not each time when you query

Re: confused about date parsing

2014-01-29 Thread Mark Hahn
It's not illegal, it's just something that would usually not make sense. The only use case I can think of is if you want a timestamp in a document indicating when it was last put in the index. Why one would need this is beyond me, but it is certainly legal. On Wed, Jan 29, 2014 at 2:45 PM,

Re: confused about date parsing

2014-01-29 Thread Robert Samuel Newson
That would prevent a user including indexed at timestamp. Admittedly an odd thing to do, but banning it seems a bit extreme. B. On 29 Jan 2014, at 22:45, Jens Alfke j...@couchbase.com wrote: On Jan 29, 2014, at 2:17 PM, Alexander Shorin kxe...@gmail.com wrote: On Thu, Jan 30, 2014 at

Re: confused about date parsing

2014-01-29 Thread Alexander Shorin
On Thu, Jan 30, 2014 at 2:45 AM, Jens Alfke j...@couchbase.com wrote: On Jan 29, 2014, at 2:17 PM, Alexander Shorin kxe...@gmail.com wrote: On Thu, Jan 30, 2014 at 2:13 AM, Dan Santner dansant...@me.com wrote: var today = new Date(); This value will be computed

Re: confused about date parsing

2014-01-29 Thread Mike Marino
Am 29.01.2014 um 23:45 schrieb Jens Alfke j...@couchbase.com: Has anyone thought of modifying the JS global bindings when a map function runs, such that calling Date.new will throw an exception? Preferably an exception with a descriptive message like It is illegal to use the current date

Re: confused about date parsing

2014-01-29 Thread Dan Santner
Alexander, your first response was very helpful. Sorry I didn't search the archives first. I get it now. Thanks everyone. Dan. On Jan 29, 2014, at 4:57 PM, Alexander Shorin kxe...@gmail.com wrote: On Thu, Jan 30, 2014 at 2:45 AM, Jens Alfke j...@couchbase.com wrote: On Jan 29, 2014, at 2:17

Re: confused about date parsing

2014-01-29 Thread Alexander Shorin
On Thu, Jan 30, 2014 at 3:01 AM, Mike Marino mmar...@gmail.com wrote: Am 29.01.2014 um 23:45 schrieb Jens Alfke j...@couchbase.com: Has anyone thought of modifying the JS global bindings when a map function runs, such that calling Date.new will throw an exception? Preferably an exception