[SERVER-65] conserve number types when going bson -> js -> bson Created: 21/May/09  Updated: 12/Jul/16  Resolved: 22/May/09

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

Type: Improvement 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

Attachments: File javascript_numbers.rb    
Participants:

 Description   

When working with things in db.eval - if you get an object from the db - try as much as possible to conserve types



 Comments   
Comment by Eliot Horowitz (Inactive) [ 26/May/09 ]

other case handled in sub-task

Comment by Yun Huang Yong [ 24/May/09 ]

Using db.eval() to copy arrays of ints.

Comment by Eliot Horowitz (Inactive) [ 24/May/09 ]

Can you send a full example? Not entirely sure what you mean or if its possible.

Comment by Yun Huang Yong [ 24/May/09 ]

This works for me with an object

{ "test": 1 }

, but fails on an array, i.e.

{ "test": [1, 2] }

which results in retrieval of

{ "test": [1.0, 2.0] }

.

Could this be also made to work on arrays?

Comment by Eliot Horowitz (Inactive) [ 22/May/09 ]

fixed

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