MongoDB Documentation, Release 3.0.4 11.8.12 How can I effectively use indexes strategy for attribute lookups? For simple attribute lookups that don’t require sorted result sets or range queries, consider creating a field that contains an array of documents where each document has a field (e.g. attrib ) that holds a specific type of attribute. You can index this attrib field. For example, the attrib field in the following document allows you to add an unlimited number of attributes types: Both of the following queries could use the same { "attrib.k": 1, "attrib.v": 1 } index: db.mycollection.find( { attrib: { $elemMatch : { k: "color", v: "blue" } } } ) db.mycollection.find( { attrib: { $elemMatch : { k: "avail", v: true } } } ) This document provides answers to common diagnostic questions and issues. If you don’t find the answer you’re looking for, check the complete list of FAQs (page 743) or post your question to the MongoDB User Mailing List$^{29}$. If mongod shuts down unexpectedly on a UNIX or UNIX-based platform, and if mongod fails to log a shutdown or error message, then check your system logs for messages pertaining to MongoDB. For example, for logs located in /var/log/messages , use the following commands: sudo grep mongod /var/log/messages sudo grep score /var/log/messages If you experience socket errors between clients and servers or between members of a sharded cluster or replica set that do not have other reasonable causes, check the TCP keepalive value (e.g. on Linux systems store, the tcp_keepalive_time value). A common keepalive period is 7200 seconds (2 hours); however, different distri- butions and OS X may have different settings. If your MongoDB deployment experiences keepalive-related issues, you must alter the keep alive value on all machines hosting MongoDB processes. This includes all machines hosting mongos or mongod servers and all machines hosting client processes that connect to MongoDB. For MongoDB, you will have better results with shorter keepalive periods, on the order of 120 seconds (two minutes). $^{29}$https://groups.google.com/forum/?fromgroups#!forum/mongodb-user 779 11.9. FAQ: MongoDB Diagnostics 11.9.1 Where can I find information about a mongod process that stopped running unexpectedly? 11.9.2 Does TCP keepalive time affect MongoDB Deployments? 11.9 FAQ: MongoDB Diagnostics { _id : ObjectId(...), attrib : [ { k: "color", v: "red" }, { k: "shape": v: "rectangle" }, { k: "color": v: "blue" }, { k: "avail": v: true } ] }