title: Query to a List of dictionaries, return the specific dictionary?
body: <p>I pushed a db as simple as, using python, pymongo and mnogodb, the db is mae of many files like the sample below:</p>
  
  <pre><code>  def pushdata():
          for filename in os.listdir(directory):        
                  with open( directory + filename , 'r') as f:
                      datastore = json.load(f)
                      m = data.insert_one(datastore) 
  </code></pre>
  
  <p>My jsons loook like that</p>
  
  <pre><code>  {
              "info": {
                  "S1": {
                      "SS": "1221"
                  },
                  "S2": {
                      "SDS011": "5121"
                  },
                  "OP": "157.138",
                  "LK": "32121",
                  "MN": "122.077"
              },
              "readings": [
                  {
                      "SS1": "7.80",
                      "SS2": "1.80",
                      "timestamp": "1530857160"
                  },
                  {
                      "SS1": "9.67",
                      "SS2": "2.53",
                      "timestamp": "1530857520"
                  },
              ]
          }
  </code></pre>
  
  <p>how can i query the data? When i try </p>
  
  <pre><code>  print(data.find_one({'$and':[{ "readings.SS1": "7.80"},
                  {"readings.SS2": "1.80"}]})) 
  </code></pre>
  
  <p>in python</p>
  
  <pre><code> print(data.find_one( "readings.SS1": "7.80"}))
  </code></pre>
  
  <p>in mongodb</p>
  
  <p>I always get the whole Database file  not the specific dictionary from the list? Why does it happen? I want query response like that:</p>
  
  <pre><code>   {
                  "SS1": "7.80",
                  "SS2": "1.80",
                  "timestamp": "1530857160"
              }
  </code></pre>
  
  <hr>
  
  <p>also for the info dictionary, how to make a query where let say 'OP'=157.138 and 15500000&lt; timestamp &lt; 15000000 , response:</p>
  
  <pre><code>  {
          "SS1": "7.80",
          "SS2": "1.80",
          "timestamp": "15100000"
      }
      {
          "SS1": "7.80",
          "SS2": "1.80",
          "timestamp": "15300000"
      }
      {
          "SS1": "7.80",
          "SS2": "1.80",
          "timestamp": "15500000"
  
  
     }
  </code></pre>