Uploaded image for project: 'S2Graph'
  1. S2Graph
  2. S2GRAPH-222

Support Not logical operator in WhereParser.

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Done
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: s2core
    • Labels:
      None

      Description

      `And/Or` operator is implemented as a logical operator, but `Not` is not implemented in WhereParser.

      This is illustrated by following examples.

      Following query works only because we added hardcoded implementation on `not in` as predicates.

      query {
        s2graph { 
          User(id: 1) {
            id
            Friends(limit: 10, filter: "friend_name not in ('steamshon')") {
              User { 
                id
              }
            }
          }
        }
      }
      
      

      I believe implementing `Not` as a logical operator is more general, so below is my suggestion.

      query {
        s2graph { 
          User(id: 1) {
            id
            Friends(limit: 10, filter: "NOT (friend_name in ('steamshon'))") {
              User { 
                id
              }
            }
          }
        }
      }
      

      In this way, we don't need to implement not case for all predicates, such as `in`, `between`, `contains`, `eq`.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                steamshon Do Yung Yoon
                Reporter:
                steamshon Do Yung Yoon
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: