আসুন আমরা নথি সহ একটি সংগ্রহ তৈরি করি -
> db.demo362.insertOne({"ClientName":"John","ClientProject":"School Management System"}); { "acknowledged" : true, "insertedId" : ObjectId("5e56a77454a481fef8ec7a1c") } > db.demo362.insertOne({"ClientName":"David","ClientProject":"Library Management System"}); { "acknowledged" : true, "insertedId" : ObjectId("5e56a78454a481fef8ec7a1d") } > db.demo362.insertOne({"ClientName":"Mike","ClientProject":"Event Tracker"}); { "acknowledged" : true, "insertedId" : ObjectId("5e56a7a054a481fef8ec7a1e") } > db.demo362.insertOne({"ClientName":"Carol","ClientProject":"Hospital Management System"}); { "acknowledged" : true, "insertedId" : ObjectId("5e56a7b754a481fef8ec7a1f") }
Find() পদ্ধতি -
এর সাহায্যে একটি সংগ্রহ থেকে সমস্ত নথি প্রদর্শন করুন> db.demo362.find();
এটি নিম্নলিখিত আউটপুট −
তৈরি করবে{ "_id" : ObjectId("5e56a77454a481fef8ec7a1c"), "ClientName" : "John", "ClientProject" : "School Management System" } { "_id" : ObjectId("5e56a78454a481fef8ec7a1d"), "ClientName" : "David", "ClientProject" : "Library Management System" } { "_id" : ObjectId("5e56a7a054a481fef8ec7a1e"), "ClientName" : "Mike", "ClientProject" : "Event Tracker" } { "_id" : ObjectId("5e56a7b754a481fef8ec7a1f"), "ClientName" : "Carol", "ClientProject" : "Hospital Management System" }
একাধিক নথি-
আনার জন্য নিম্নলিখিত ক্যোয়ারী রয়েছে৷> db.demo362.find({$or: [{"ClientName":"John"}, {"ClientProject": "Event Tracker" }]});
এটি নিম্নলিখিত আউটপুট −
তৈরি করবে{ "_id" : ObjectId("5e56a77454a481fef8ec7a1c"), "ClientName" : "John", "ClientProject" : "School Management System" } { "_id" : ObjectId("5e56a7a054a481fef8ec7a1e"), "ClientName" : "Mike", "ClientProject" : "Event Tracker" }