title: Dynamoose query by different attributes (Node.js)
body: <p>I need to get record (-s) from <code>DynamoDB</code> via <code>Dynamoose</code> by non-key attribute. For example, I need to get all records from the table <code>someModel</code> where the field <code>my_field</code> is equal to <code>111</code>. I do it by the next way:</p>
  
  <pre><code>const data = await someModel.query("my_field").eq("111").exec();
  </code></pre>
  
  <p>And this code stops executing! I mean that following code after that is not called.</p>
  
  <p>If I change code to this:</p>
  
  <pre><code>const data = await someModel.query("my_field").eq("111");
  </code></pre>
  
  <p>my query is working, but <code>data</code> contains:</p>
  
  <pre><code>{
    "options": {
      "all": {
        "delay": 0,
        "max": 1
      }
    },
    "query": {
      "hashKey": {
        "name": "my_field",
        "value": "111"
      }
    },
    "filters": {},
    "buildState": false,
    "validationError": null,
    "notState": false,
    "success": true
  }
  </code></pre>
  
  <p>I understand that above code is prepared query parameters for query but how can I apply them and execute query to <code>DynamoDB</code>? Of course the query code is placing inside <code>async</code> function - that is why <code>await</code> is written there.</p>
  
  <p>I use also <code>serverless</code> framework for describing <code>DynamoDB</code> schemes. But all models I write via <code>dynamoose</code>.</p>
  
  <p>Where am I mistaking?</p>