GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — query.filter with OR · Issue #82 · googleapis/google-cloud-node

query.filter with OR #82

New issue
Copy link
New issue
Copy link
Closed
Closed
query.filter with OR#82
Copy link
Assignees
ryanseys
Labels
🚨This issue needs some love.api: datastoreIssues related to the Datastore API.triage meI really want to be triaged.
Milestone
Datastore Future

Description

@pcostell
pcostell
opened on Aug 1, 2014
Issue body actions

Right now Datastore doesn't natively support OR filters, however it is a feature we'd like to support. When switching from GAE Datastore to Cloud Datastore filters were explicitly changed from being represented as a list to a more hierarchical model to support this. There should be a plan in place for how to expose this, since now filters are assumed to be AND'ed together.

Activity

Next
  1. pcostell
    changed the title [-]query.filter with OR[/-] [+]datastore: query.filter with OR[/+] on Aug 1, 2014
  2. rakyll
    added this to the This milestone has been deleted milestone on Aug 5, 2014
  3. rakyll
    added
    enhancement
    on Aug 7, 2014
  4. stephenplusplus
    changed the title [-]datastore: query.filter with OR[/-] [+]query.filter with OR[/+] on Jan 20, 2015
  5. stephenplusplus
    added
    api: datastoreIssues related to the Datastore API.
    on Jan 20, 2015
  6. ryanseys commented on Jan 30, 2015

    @ryanseys
    ryanseys
    on Jan 30, 2015
    Contributor
    More actions

    Currently queries are ANDed together by chaining .filter() calls:

    var companyQuery = datastore.createQuery('Animal', ['Lion', 'Chimp'])
      .filter('name =', 'Frank');
      .filter('kgs <', 50);

    We could support OR with the addition of a .or() and rename .filter() to .and():

    var companyQuery = datastore.createQuery('Animal', ['Lion', 'Chimp'])
      .and('name =', 'Frank');
      .or('kgs <', 50);

    The Java library supports this by making a separate API call for every filter separated by ORs. In this sense, the entire filter is always evaluated in disjunctive normal form which is the simplest way to define it and evaluate it. If an .or() is attempted first before an .and() (.filter()) we could just throw an error.

  7. dhermes commented on Jan 31, 2015

    @dhermes
    dhermes
    on Jan 31, 2015
    Contributor
    More actions

    @pcostell This is presumably something that should happen across all libraries, yes?

    @ryanseys I'm curious, does the Java implementation attempt to squash / merge duplicates?

    /cc @tseaver

  8. ryanseys commented on Jan 31, 2015

    @ryanseys
    ryanseys
    on Jan 31, 2015
    Contributor
    More actions

    @dhermes I'm not experienced with the Java library's implementation but as far as I understand from their documentation, they make no such attempt to squash duplicates or handle logical errors in the filter (e.g. height < 400 AND height > 400).

  9. jgeewax
    modified the milestones: Datastore Stable, This milestone has been deleted on Feb 2, 2015
  10. pcostell commented on Feb 2, 2015

    @pcostell
    pcostell
    on Feb 2, 2015
    ContributorAuthor
    More actions

    There is a future goal to support or natively in the Cloud Datastore API. I'm not sure on a timeline, but it may be worth it to just wait so there is native support. There are a lot of weird edge cases with using the DNF.

  11. ryanseys commented on Feb 2, 2015

    @ryanseys
    ryanseys
    on Feb 2, 2015
    Contributor
    More actions

    Ok I'm going to close this until support is made. Feel free to reopen once the API supports that functionality. I don't think it should be too difficult to support it in this library once the API does.

  12. ryanseys
    closed this as completedon Feb 2, 2015
  13. ryanseys
    modified the milestones: Datastore Future, Datastore Stable on Feb 4, 2015
  14. 91 remaining items

  15. codyoss
    added a commit that references this issue on Mar 5, 2026

    docs: update contributing path in README (#82)

    33d6dbf
  16. GautamSharda
    added a commit that references this issue on Mar 5, 2026

    1.1.5 (#82)

    138742d
  17. sofisl
    added 2 commits that reference this issue on Mar 5, 2026

    chore: Retry request migration (#858)

    6dcb8a6

    Release v0.17.0 (#82)

    9615bb6
  18. codyoss
    added 2 commits that reference this issue on Mar 9, 2026

    build: check broken links in generated docs (#82)

    fee3305

    build: check broken links in generated docs (#82)

    572cf95
  19. GautamSharda
    added a commit that references this issue on Mar 11, 2026

    Fix ackDeadline configuration for subscription (#82)

    93f1897
  20. codyoss
    added a commit that references this issue on Mar 12, 2026

    build: add GitHub actions config for unit tests (#82)

    2ecbdd1
  21. GautamSharda
    added 2 commits that reference this issue on Mar 12, 2026

    feat: add callbackify() and callbackifyAll() methods (#82)

    1214546

    feat: add callbackify() and callbackifyAll() methods (#82)

    7e79c3f
  22. thiyaguk09
    added a commit that references this issue on Mar 18, 2026

    Test un-authenticated downloads and uploads. (googleapis#82)

    508356e
  23. GautamSharda
    added 2 commits that reference this issue on Mar 23, 2026

    added waitForReplication method to implement consistency-token check (#…

    f53f6b5

    added waitForReplication method to implement consistency-token check (#…

    a1b0f67
  24. shivanee-p
    added a commit that references this issue on Mar 27, 2026

    added waitForReplication method to implement consistency-token check (#…

    df17374
  25. thiyaguk09
    added a commit that references this issue on May 5, 2026

    added waitForReplication method to implement consistency-token check (g…

    c79e8a0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @ryanseys
    ryanseys

Labels

🚨This issue needs some love.api: datastoreIssues related to the Datastore API.triage meI really want to be triaged.

Type

No type

Projects

No projects

    Milestone

    • Datastore FutureNo due date

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.