MongoDB – Analyzing Queries Analyzing queries is a very important aspect of measuring how effective the database and indexing design is. We will learn about the frequently used $explain and $hint queries. Using $explain The $explain operator provides information on the query, indexes used in a query and other statistics. It is very useful when […]
Category Archives: mongodb
MongoDB – Advanced Indexing we have inserted the following document in the collection named users as shown below − db.users.insert( { “address”: { “city”: “Los Angeles”, “state”: “California”, “pincode”: “123” }, “tags”: [ “music”, “cricket”, “blogs” ], “name”: “Tom Benzamin” } ) The above document contains an address sub-document and a tags array. Indexing Array […]
MongoDB – ObjectId We have been using MongoDB Object Id in all the previous chapters. In this chapter, we will understand the structure of ObjectId. An ObjectId is a 12-byte BSON type having the following structure − The first 4 bytes representing the seconds since the unix epoch The next 3 bytes are the machine […]