title: Use beginsWith to search in sort key using dynamoose .get
body: <p>I'm starting to learn Dynamodb here, and currently trying to do a search on my table where PK is the partition key and SK is the range key. PK contains an email address, whereas SK contains value like <code>AB_STATE</code>, <code>BC_STATE</code>, <code>MY_STATE</code>. So I want to search in the SK where the value starts with <code>MY_</code> but I'm not entirely sure how to do it using <code>.get()</code> function.</p>
  <p>Here's my query <code>Seller.get({ &quot;PK&quot;: &quot;imin@cats.com&quot;, &quot;SK&quot; : &quot;MY&quot; })</code> which obviously isn't doing what I wants.</p>
  <p>I am aware that I maybe can use filter like below, but I read in many places that using filter is not recommended (?)</p>
  <pre><code>var filter = new dynamoose.Condition().where(&quot;PK&quot;).eq(email).filter(&quot;SK&quot;).beginsWith(&quot;MY_&quot;);
  var premiseProfile = await Seller.query(filter).exec()
  </code></pre>
  <p>Below is the schema for my Seller table</p>
  <pre><code>const schema = new dynamoose.Schema({
      PK: {
          type: String,   
          hashKey: true,
      },
      SK: {
          type: String,   
          rangeKey: true,
      },
      &quot;firstName&quot;: String,
      &quot;lastName&quot;: String,
      &quot;gender&quot;: {
          &quot;type&quot;: Number,
          &quot;default&quot;: 0
      },
  }, {
      &quot;saveUnknown&quot;: true,
      &quot;timestamps&quot;: true
  });
  </code></pre>