[SERVER-2064] $sysdate for inserts/updates Created: 05/Nov/10 Updated: 17/Jan/18 Resolved: 26/Feb/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Usability |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor - P4 |
| Reporter: | Christoph Preissner | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 4 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
all |
||
| Issue Links: |
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
I would like to ask for the following feature: on inserts/updates I would like to have a "placeholder" like "$sysdate" as argument, telling the database engine to replace the "$sysdate-placeholder" by the current database UTC before putting it in the internal mongodb queue. e.g.: db.coll.insert( {"tx":"test string","timestamp":$sysdate}) The advantage would be that one can be sure that sorting by the timestamp of the document field results in the 100% sortorder of insertion; if I insert data from different machines, I have no guarantee about the insertion sortorder in the internal queue of MongoDB for persisting ( depending on the application delay for "getting the data and pushing it to mongodb" ). Thank you for taking this into consideration,ยด |
| Comments |
| Comment by David Storch [ 26/Feb/16 ] |
|
Closing as a duplicate of SERVER-13695. |
| Comment by Aleksandar Kostadinov [ 28/Oct/14 ] |
|
It would be very useful if arithmetic operations are possible with current date. For example if resource reservation is implemented and one is doing findAndModify atomic operation on that resource, it would be very useful to be able to set document's `reserved_until` field to `$now+##units`. |
| Comment by Abhishek Guha Thakurta [ 03/Sep/14 ] |
|
Hello Fred, { $match : { <our date field> : "$date:now" }} |
| Comment by Fred Stluka [ 07/Apr/11 ] |
|
This would be a very useful feature. Exactly like the sysdate feature of MySQL, Oracle, and others. Here's what we're doing now: We don't want dates captured in the Web client. So instead of passing So far, so good, but we still need a way for the various Web servers to |