[SERVER-9039] Enhancement of Server Side Created MongoTimestamp (0 filled) Created: 20/Mar/13 Updated: 19/Apr/13 Resolved: 01/Apr/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Jeremy | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | timestamp | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
MongoDB has built in an incredible 'feature' that, if enhanced just a little bit, would take things to the next level for us. It seems the MongoTimestamp that is created server-side by sending with 0-value seems to be thought of only as an 'internal' feature used for Replication/Oplog. But for us, this has become the staple of our entire API platform. It really is one of the best things about Mongod...being able to insert this unique timestamp_inc is extremely powerful for anyone trying build a system that supports polling of inserted/updated records (get what is new/changed since XYZ). However...the limitation of having it only work on 1 field, and also only work during entire 'update' is tough to overcome. Here is what I would like to see as an enhancement: 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_inc. If you are wondering why I need this, it provides capacity to mark a unique 'creation' timestamp_increment as well as a 'updated' timestamp_increment. In case of insertion, they should be the same. During an update, we restamp the 'updated' field. Having both means that doing polling queries for any records 'updated' or 'created' since [timestamp_inc] can be done with a single query on 'updated' gte [timestamp_inc]. As it is now, we have to do 2 queries, merge the results, and sort & limit with code, which takes all the fun out of it :}. The other option we have tried is to insert the record, then immediately retrive it, and update it again saving the 'updated' timestamp_inc with the value in 'created'---also a really miserable thing to have to be doing. 2) Make it possible to do a $set on a document with the 0-valued timestamp to update field with server timestamp_inc. These 2 items, i've been wanting since 2010--- see other ticket. https://jira.mongodb.org/browse/SERVER-1650 I made this new ticket because I think the other one isn't quite clear enough. |
| Comments |
| Comment by Jeremy [ 19/Apr/13 ] |
|
It covers it because my comments are included in that ticket, but the concept of a 'server side timestamp' for some may not the same as a server side MongoTimestamp (ts + increment). The ts + increment is what I need more control over. Just a timestamp alone without the increment will not help. |
| Comment by Eliot Horowitz (Inactive) [ 01/Apr/13 ] |
|
I think |