- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to print NumberLong value in MongoDB?
The mongo shell provides the NumberLong() wrapper to handle 64-bit integers. Following is the syntax using custom variable and print using toString() −
var anyVariableName=NumberLong("yourLongNumber"); yourVariableName.toString();
To understand the above concept, let us implement the above syntax −
> var number=NumberLong("231231231231121231"); > number.toString();
This will produce the following output −
NumberLong("231231231231121231")
The second example is as follows to display NumberLong −
> var anotherNumber=NumberLong("765765765765567576"); > anotherNumber.toString();
This will produce the following output −
NumberLong("765765765765567576")
- Related Articles
- Difference between NumberLong(x) and NumberLong(“x”) in MongoDB?
- Convert NumberLong to String in MongoDB?
- How to print document value in MongoDB shell?
- Find and replace NumberLong type field in MongoDB?
- How to print results of script in MongoDB?
- How to find minimum value in MongoDB?
- How to print to console an object in a MongoDB script?
- How to pop a single value in MongoDB?
- How to Read and Print an Integer value in C++
- How to push value with for loop in MongoDB?
- How to exclude array type field value in MongoDB?
- How to convert value to string using $toString in MongoDB?
- How to return only value of a field in MongoDB?
- How to pull value from array of ObjectIDs in MongoDB?
- How to query MongoDB a value with $lte and $in?

Advertisements