title: How can I retrieve a single record from the Google App Engine Datastore?
body: <p>Using Google App Engine and GQL and Python:</p>
  
  <p>in my datastore I have something like the following</p>
  
  <pre><code>class Thing(db.Model):
     domain = db.StringProperty(required=True)
     name = db.StringProperty()
     ...more...
  </code></pre>
  
  <p>and in my handler I have</p>
  
  <pre><code>currentThing = db.GqlQuery("SELECT * FROM Thing WHERE domain=:1 LIMIT 1",
                                         "example.com")
  </code></pre>
  
  <p>I know this will at MOST return one Thing but I can't seem to find a way to collect that one thing in a Thing object without going through a looping process which seems a bit odd to me.</p>
  
  <p>I've also tried using the <code>Thing.gql("WHERE domain=:1 LIMIT 1", "example.com")</code> syntax to no avail.  They all seem to return collections.</p>
  
  <p>I'm coming from a .NET background and am new to Python and App Engine, but I'm looking for something similar to the .FirstOrDefault() functionality.</p>