[SERVER-19386] insert {_id:Timestamp()} no longer expand Created: 14/Jul/15 Updated: 15/Jul/15 Resolved: 14/Jul/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | wenchaomeng | Assignee: | Sam Kleinman (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
I use mongo2.2, insert data as follows: {_id:Timestamp()} Timestamp will expand. but in mongo2.6 and mongo 3.0, it won't expand. Is there a way to support that? |
| Comments |
| Comment by Daniel Pasette (Inactive) [ 15/Jul/15 ] |
|
There isn't a perfect workaround for your situation other than changing your code on the client side. See Is it possible for you to change your application to set the Timestamp for the _id on the client ? |
| Comment by wenchaomeng [ 15/Jul/15 ] |
|
Thanks a lot for your answer! There are some issuse I have to consider: 1、This has to be supported from mongo2.2 to mongo3.0(Now I am using 2.2, and I want to upgrade it to 3.0 ) Do you have any idea about that? |
| Comment by Sam Kleinman (Inactive) [ 14/Jul/15 ] |
|
I would encourage you to consider the Date() constructor to generate a date object in the mongo shell javascript client, if that's what you're looking for. You can also use the $currentDate docs update operator in 2.6 and later. Also see the release notes section in the documentation on the new releases for MongoDB, including complete upgrade instructions. The SERVER project is for bugs and feature requests related to the core MongoDB database server. Questions like this are probably best suited to the mongodb-users group or Stack Overflow with the mongodb tag. Regards, |