FIND ALL RECORDS IN COLLECTION

FIND ( ) 

SYNTAX

db.<COLLECTION_NAME>.find( )

It’s equal to select * from table in RDBMS

db.dac.find()
{ "_id" : ObjectId("5a28048ad5c3a168fb652e32"), "id" : 1, "name" : "sachin" }
{ "_id" : ObjectId("5a280495d5c3a168fb652e33"), "id" : 2, "name" : "pooja" }
{ "_id" : ObjectId("5a28049ed5c3a168fb652e34"), "id" : 3, "name" : "ankita" }
{ "_id" : ObjectId("5a2804a8d5c3a168fb652e35"), "id" : 4, "name" : "mahesh" }

Find ( )  will give all documents in collection in unstructured format.

To see all records in structured format use pretty( ) Method