Skip to content

Datastore like queries #1133

Description

@j-5-s

I realize datastore does not have like queries but is there an example of how to do a filter such as

db.GqlQuery("SELECT * FROM MyModel WHERE prop >= :1 AND prop < :2",
            "abc",
            u"abc" + u"\ufffd")

Can you do this with the current API using the .filter() method?

Activity

  1. stephenplusplus commented on Feb 18, 2016

    @stephenplusplus
    Contributor

    I believe what would work is:

    var query = dataset.createQuery('MyModel')
      .filter('prop', '>=', 'abc')
      .filter('prop', '<', 'def');
    
    dataset.runQuery(query, function(err, results) {});
  2. j-5-s commented on Feb 18, 2016

    @j-5-s
    Author

    Perfect, thank you!

  3. 1 remaining item

  4. added 2 commits that reference this issue on Feb 25, 2026
    73026c4
    620d708
  5. added 2 commits that reference this issue on Mar 18, 2026
    7beb07c
    179ce06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: datastoreIssues related to the Datastore API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions