title: MongoDB: Query a key having space in its name
body: <p>I want to retrieve values of only certain keys from a MongoDB collection. </p>
  
  <p>But, the collection has some keys which have a 'space' in their name like:</p>
  
  <pre><code>"Parent":{"key1": //some string,
            "key2": //some string,
            "key 3": //some string}
  </code></pre>
  
  <p>I know this is a wrong approach as there shouldn't ideally be spaces in a key name but nevertheless how do I query this key? I am using Python and PyMongo. </p>
  
  <p>For normal keys I can do this:</p>
  
  <pre><code>db.coll_name.find({"key": "India"}, {"_id": 0, "Parent.key1": 1, "Parent.key2": 1})
  </code></pre>
  
  <p>So how do I use the key "Parent['key 3']" in the second argument of the above query?  Is there any way to achieve this?</p>
  
  <p><strong>Here's the query which returns data(works):</strong></p>
  
  <pre><code>db.coll_name.find({}, {"Parent.key1": 1, "_id": 0})
  </code></pre>
  
  <p><strong>Here's the query which doesn't return data:</strong></p>
  
  <pre><code>db.coll_name.find({}, {"Parent['key 3']": 1, "_id": 0})
  </code></pre>