× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
ranarohitp(*) reported 2014-04-29T06:37:02Z  · tariqrahiman last modified 2014-04-30T17:43:10Z

Wrong value for day of year is returned


Dev
Jenny Nishimura
JennyNishimura
QA
Tariq Rahiman
tariqrahiman
Priority Low
Complexity Unknown
Component MongoShell
Version 15.0

Aqua Data Studio 15.0.0-dev-256
Build #: 37570
Built on: 2014-Apr-28 05:22:50 PM.

Mong DB : 2.6.

  1. Make Connection to MongoDB and execute below given script in Query Analyzer.

    INSERT INTO "dttable"( "dtcolumns") VALUES (
        DATE('2014-01-01')
        )
    GO
  2. Now Launch Mongo Shell from ADS and execute below given script.

     db.dttable.aggregate( [                                                                                                                                                                                                   
        { $project: { dayOfYear: { $dayOfYear: "$dtcolumns"  } } }                                                                                                                                                         
    ] )
  3. You will observe that value returned for variable "dayOfYear" will be 365, where it should have returned value as 1.
  4. You can look at below given link to check $dayOfYear operator functionality.

    http://docs.mongodb.org/manual/reference/operator/aggregation/dayOfYear/#exp._S_dayOfYear
2 attachments

Issue #11969

Closed
Invalid
Resolved 2014-04-30T17:31:55Z
 
 
Completion
No due date
No fixed build
No time estimate

About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017