[SERVER-6150] $isoDate cannot be created with field values other than 0 and 1 Created: 20/Jun/12  Updated: 15/Aug/12  Resolved: 03/Jul/12

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Matt Dannenberg
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-5762 conversions to dates don't accept con... Closed
Operating System: ALL
Participants:

 Description   

Seems to be related to a parsing issue.

c = db.c;
c.drop();
 
c.save( {} );
// Seems to work, using syntax similar to that in testall.js.                                   
printjson( c.aggregate( { $project : { date: { $isoDate:[{ year:1 }] } } } ) );
// Seems to not work because the year value is not 1 or 0.                              
printjson( c.aggregate( { $project : { date: { $isoDate:[{ year:2 }] } } } ) );
// Seems to not work using syntax from documentation page.                                   
printjson( c.aggregate( { $project : { date: { $isoDate:{ '$year':2 } } } } ) );
printjson( c.aggregate( { $project : { date: { $isoDate:[{ '$year':2 }] } } } ) );

Observed behavior: assertions when trying to create a date with { $isoDate:[

{ year:1 }

] }.
Expected behavior: a valid date is created.



 Comments   
Comment by Mathias Stearn [ 03/Jul/12 ]

Superseded by SERVER-6290

Comment by auto [ 03/Jul/12 ]

Author:

{u'date': u'2012-07-02T16:46:27-07:00', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: SERVER-6150 removing $isoDate operator
Branch: master
https://github.com/mongodb/docs/commit/48a69b5cfe5a8a2702aaf758211d137deacbaa99

Generated at Thu Feb 08 03:10:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.