Tuesday, 20 June 2023

How to so select certain colum to be shown in MongoDB

 Today i will try to share about "How to so select certain colum to be shown in MongoDB", Ok let see example scripts below :

db.demo415.find({},{_id:0,ClientName:1});

The out example for this script are :

{ "ClientCountryName" : "US" }
{ "ClientCountryName" : "UK" } 

{ "ClientCountryName" : "AUS" } 


Note : Parmeter with _id = 0 or ClientName = 1, value 0 not displaying the data and value 0 is diplaying the data.


Hope this information can helping you, Thanks.




Source : https://www.tutorialspoint.com/how-to-select-specific-columns-in-mongodb-query


No comments:

Post a Comment