MongoDB find() method
kodingwindow@kw:~$ mongosh ... DB> show dbs DB 72.00 KiB admin 40.00 KiB config 108.00 KiB local 40.00 KiB DB> db.getCollectionNames() [ "holders" ] DB> db.holders.find() [ { _id: ObjectId("6515552821cddd458cbbcc91"), account_no: 2562348989, name: 'James Moore', city: 'Phoenix', DOB: ISODate("1985-05-26T00:00:00.000Z"), bank: 'Barclays', amount: 5000, loan: [ { Personal: 5660, Home: 15000 } ] }, { _id: ObjectId("6515554d21cddd458cbbcc92"), account_no: 2562348990, name: 'Donald Taylor', city: 'Irvine', DOB: ISODate("1990-08-20T00:00:00.000Z"), bank: 'Citi', amount: 7000, loan: [ { Home: 10000, Car: 20000 } ] }, { _id: ObjectId("6515554d21cddd458cbbcc93"), account_no: 2562348991, name: 'Edward Parkar', city: 'Irvine', DOB: ISODate("1994-01-29T00:00:00.000Z"), bank: 'ICICI', amount: 95000, loan: [ { Personal: 25000, Home: 450000, Car: 10000 } ] }, { _id: ObjectId("6515554d21cddd458cbbcc94"), account_no: 2562348992, name: 'Ryan Bakshi', city: 'Mumbai', DOB: ISODate("1982-01-14T00:00:00.000Z"), bank: 'Citi', amount: 50000, loan: [ { Personal: null, Home: null, Car: null } ] } ]
What Next?
MongoDB Logical Query Operators ($and $or $nor $not)
MongoDB Projection (limiting and sorting data)
MongoDB Update a Document
Advertisement