Changing the data type of a field returned with undefined

Kevin Xiong shared this problem 5 months ago
Cannot Reproduce

I used javascript like below to align the data type of a field(from NumberInt to NumberLong), it was working well with old version(v-3.5.3 on Windows Server2008 R2) , but not working in the lastest version(v-7.0.4 on Window 10), just returned with undefined

db.CollectionXXX.find({...}).forEach(function(obj) {    
    obj.fieldXXX= new NumberLong(obj.fieldXXX+"");
    db.CollectionXXX.save(obj);
});

Replies (1)

photo
1

If you're reporting a bug, please make sure you include steps to reproduce it.


1. NoSQLBooster Version e.g. 7.0.5

2. Operating System e.g. macOS 10.13.6 / Windows 10 1803 / Ubuntu 20.04

3. Expected Behavior

4. Actual Behavior

5. How to reproduce, step by step. (Please include some sample data in your script)

6. Screenshots

Leave a Comment
 
Attach a file