[SERVER-15367] Look for empty BSONTimestamp after "_class" field Created: 24/Sep/14  Updated: 24/Sep/14  Resolved: 24/Sep/14

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: John Butler Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

When using Spring Data to insert an Object, Spring Data will ALWAYS assign "_class" as the first field of the DBObject. This precludes the ability to insert a BSONTimestamp at the beginning of a DBObject to allow it to be populated server-side. The ability to assign a timestamp value server-side is critical to our application (because we have multiple clients running concurrently). The limitation of only looking at the first field (after "_id") prevents the ability to use Spring Data.



 Comments   
Comment by Ramon Fernandez Marina [ 24/Sep/14 ]

dancerjohn, thanks for your report. This behavior is new in the 2.6 series, so I've opened DOCS-4082 to update the documentation.

Regards,
Ramón.

Comment by John Butler [ 24/Sep/14 ]

Documentation on this page should be updated: http://docs.mongodb.org/manual/reference/bson-types/

Comment by John Butler [ 24/Sep/14 ]

In which version was this change made?

Comment by Scott Hernandez (Inactive) [ 24/Sep/14 ]

In my test I can't reproduce this with the current version (which now checks all top-level fields on insert):

> db.a.insert({_class:"foo", _id:"ts", ts: new Timestamp()})
> db.a.find({_id:"ts"}
... )
{ "_id" : "ts", "_class" : "foo", "ts" : Timestamp(1411565260, 1) }

Also, this is best addressed in your client as the server has clear definition on expected behavior.

Generated at Thu Feb 08 03:37:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.