[DOCS-4082] Update documentation on timestamp constructor Created: 24/Sep/14  Updated: 16/Mar/15  Resolved: 07/Oct/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.12

Type: Bug Priority: Major - P3
Reporter: Ramon Fernandez Marina Assignee: Andrew Aldridge
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to DOCS-4086 How to store local time in MongoDB? Closed
Participants:
Days since reply: 9 years, 18 weeks ago

 Description   

Timestamps documentation reads:

If you create a BSON Timestamp using the empty constructor (e.g. new Timestamp()), MongoDB will only generate a timestamp if you use the constructor in the first field of the document. [2] Otherwise, MongoDB will generate an empty timestamp value (i.e. Timestamp(0, 0).)

And then:

[2]
If the first field in the document is _id, then you can generate a timestamp in the second field of a document.

In the following example, MongoDB will generate a Timestamp value, even though the Timestamp() constructor is not in the first field in the document:

db.bios.insert( { _id: 9, last_updated: new Timestamp() } )

But as shown in SERVER-15367 this is no longer the case. The behavior seems be be new in 2.6.



 Comments   
Comment by Githook User [ 15/Oct/14 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-4082: edits to timestamp change
Branch: master
https://github.com/mongodb/docs/commit/2b2432618ee580e7361ddd542a18fff2e015bcf3

Comment by Githook User [ 15/Oct/14 ]

Author:

{u'username': u'i80and', u'name': u'Andrew Aldridge', u'email': u'i80and@foxquill.com'}

Message: DOCS-4082: Timestamp() update

Signed-off-by: Sam Kleinman <samk@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/4490a91cefd5380f2e74274a4c9ff83b22511452

Generated at Thu Feb 08 07:47:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.