Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9147351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:58:02+00:00 2026-06-17T10:58:02+00:00

Say I have a collection with objects like this, where the ts property contains

  • 0

Say I have a collection with objects like this, where the ts property contains an Unix Timestamp.

{ 
  "_id" : ObjectId("50ef1e0f1e816a74ad835a5a"), 
  "ts" : 1357851660 
}

Is there a way to convert the ts field to an ISODate using the Aggregation Framework, so I can use the date operators ($dayOfYear, $dayOfMonth, …)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:58:03+00:00Added an answer on June 17, 2026 at 10:58 am

    All information and testing I could find out indicates this is not possible as of MongoDB 2.2.2. It’s fairly easy to implement using Map/Reduce though.

    Marking this as answered as this seems to be the best answer available right now, but I’m willing to review this in the future if new functionality is added to MongoDB to support this, or if someone comes up with a good workaround.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a collection of Person objects, each of which looks like
Let's say I have a variable like this: var a = this.property || this.parent.anotherProperty;
Let's say I have a collection of objects which can be sorted using a
Let's say we have a collection of Person objects class Person { public string
Let's say I have a collection of 'items' like so: <p class=item>Item 1</p> <p
Let's say I have a collection like: $products = Mage::getModel('catalog/product') ->getCollection() ... ->load(); How
This is a long shot, I know... Let's say I have a collection List<MyClass>
Let's say I have a template like this <script id=rowTemplate type=text/x-jquery-tmpl> <tr> <a href=${
I have a 2 collection of varying objects. Let's say I have the following
Let's say my domain looks like this: I have an object, Vehicle, that has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.