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 – 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 […]
MongoDB – Atomic Operations Model Data for Atomic Operations The recommended approach to maintain atomicity would be to keep all the related information, which is frequently updated together in a single document using embedded documents. This would make sure that all the updates for a single document are atomic. Assume we have created a collection […]