[SERVER-1650] Server Side Timestamps Created: 21/Aug/10 Updated: 07/Mar/14 Resolved: 07/Oct/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor - P4 |
| Reporter: | Travis Whitton | Assignee: | Scott Hernandez (Inactive) |
| Resolution: | Duplicate | Votes: | 25 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||
| Description |
|
Currently the only way to set a timestamp when doing an update is to pass a date value from the client. It would be nice to have server side timestamps allowing you to do something similar to this: db.data.update( { _id : uuid }, { '$set' : { foo : 'bar', tsModified : '$now' }}) |
| Comments |
| Comment by Scott Hernandez (Inactive) [ 07/Oct/13 ] |
|
This has been implemented in |
| Comment by Jeremy [ 21/Aug/13 ] |
|
Hello. Anyone watching this feature, please checkout the request for 'Support Timestamp(0,0) server replace for update (mods)' and vote for it if you think it would help in your case. https://jira.mongodb.org/browse/SERVER-10123 Thanks! Jeremy |
| Comment by Jeremy [ 19/Apr/13 ] |
|
NOTE: My ticket 9039 was closed but wanted to point out that the author of this ticket is asking for something different that myself and probably Joe Waller. The concept of a 'server side timestamp' may not the same as a server side MongoTimestamp (ts + increment). The ts + increment is what we need more control over for polling. Just a timestamp alone without the increment will not help. |
| Comment by Joe Waller [ 18/Dec/12 ] |
|
This is a pretty big issue for me as well. My application periodically polls a collection for changes and reindexes the modified documents in a full text search server. This has been unreliable using client side generated timestamps as the query for retrieving documents for reindexing ofter occurs between the time a timestamp is created and when it is updated in the collection by another client. Server side timestamps would be a good solution for this. |
| Comment by Jeremy [ 24/Aug/12 ] |
|
Bump on this issue. More flexibility on the MongoTimestamp (server-side) would be super helpful feature for us. My points 1 and 2 above still apply. Thanks |
| Comment by Jeremy [ 07/Apr/12 ] |
|
YEAH! Thanks Eliot. |
| Comment by Jeremy [ 06/Apr/12 ] |
|
Feeling all alone here, but I see there are 16 votes for this. Nevermind the microseconds.. just need better support for what you already have. Suggestion is to simply make the following possible: 1) Inserting the 0-valued timestamp should continue to work as is, but we should be able to do this for more than 1 field. Even if you only supported 2 fields that would be FANTASTIC! For example, if I put 0-valued timestamps in first 2 fields, I want them both marked with the same timestamp. If you are wondering why I need this, it provides capacity to mark a 'created' time as well as a 'updated' time. In case of insertion, they should be the same. Having both means that doing polling queries for any records 'updated' or 'inserted' since XYZ can be done with a single query on 'updated' gte [timestamp_inc]. As is, I have to do 2 queries, merge the results, and sort & limit with code, which takes all the fun out of it :} 2) Make it possible to do a $set on a document with the 0-valued timestamp to update field with server timestamp_inc. Thanks Again! Jeremy |
| Comment by Jeremy [ 26/Aug/11 ] |
|
We get around this by using the null Timestamp insert trick as explained here http://groups.google.com/group/mongodb-user/browse_thread/thread/e2fb8c6a993ddca1/4352163c3264d370?lnk=gst&q=timestamp#4352163c3264d370 However, it really would be nice to not have to upsert an entire record just to $set the ts with a new serverside generated timestamp. |
| Comment by Jeremy [ 08/Dec/10 ] |
|
--first comment was confusing.. removed |