[SERVER-83] Inserting Date(0) creates empty object Created: 01/Jun/09  Updated: 12/Jul/16  Resolved: 01/Jun/09

Status: Closed
Project: Core Server
Component/s: JavaScript, Shell
Affects Version/s: 0.9.3
Fix Version/s: 0.9.4

Type: Bug Priority: Minor - P4
Reporter: Yun Huang Yong Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Using the Mongo shell:

Pre-SpiderMonkey (using an old nightly from 2009-05-04):

> db.test.remove()
> db.test.insert(

{'d':new Date(0)}

)

{"d" : "Thu Jan 01 1970 00:00:00 GMT+0000 (UTC)" , "_id" : "4a23b8615b7500843af9a5e3"}

With the latest nightly:

> db.test.remove()
> db.test.insert(

{'d':new Date(0)}

)
> db.test.find()
{"_id" : "4a23b88b02d692f259b63728" , "d" : {}}

Any idea why an empty object is inserted?



 Comments   
Comment by Yun Huang Yong [ 02/Jun/09 ]

Thanks, works for me.

Generated at Thu Feb 08 02:52:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.