Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How to insert an 8-byte integer into MongoDB through JavaScript shell?
You can use below syntax for inserting an 8-byte integer in MongoDB through JavaScript shell −
anyVariableName= {"yourFieldName" : new NumberLong("yourValue")};
To display the above variable, you can use the variable name or printjson(). Following is the query to insert 8 byte integer in MongoDB −
> userDetail = {"userId" : new NumberLong("98686869")};
{ "userId" : NumberLong(98686869) }
Let us display the above variable value using variable name. The query is as follows −
> userDetail
This will produce the following output −
{ "userId" : NumberLong(98686869) }
Let us display the variable value using printjson() −
> printjson(userDetail);
This will produce the following output −
{ "userId" : NumberLong(98686869) } Advertisements
