Converting character types using the MONGO shell

Source: Internet
Author: User
Tags mongo shell

The MongoDB data types are as follows:

Type corresponding numbers Alias Description
Double1 1 Double
String 2 String
Object 3 Object
Array 4 Array
Binary data 5 Bindata
Undefined 6 Undefined Deprecated
ObjectId 7 ObjectId
Boolean 8 "BOOL"
Date 9 "Date"
Null 10 "NULL"
Regular Expression 11 "Regex"
Dbpointer 12 "Dbpointer"
Javascript 13 "JavaScript"
Symbol 14 "Symbol"
JavaScript (with scope) 15 "Javascriptwithscope"
32-bit integer 16 "Int"
Timestamp 17 "Timestamp"
64-bit integer 18 "Long"
Min Key -1 "Minkey"
Max Key 127 "Maxkey"

JS Modify statement:

Db.getcollection (' Log_pages_day '). Find ({' UV ': {$type:} }). ForEach(function(x) {     =numberint (X.UV);    Db.log_pages_day.save (x);    

Converting character types using the MONGO shell

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.