You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/05/26 13:58:19 UTC

[GitHub] [couchdb] glynnbird edited a comment on pull request #3582: adds operators $sizeLte and $sizeGte

glynnbird edited a comment on pull request #3582:
URL: https://github.com/apache/couchdb/pull/3582#issuecomment-848792131


   Thanks for the contribution @hklarner. On a broader question the new operators you are creating:
   
   - `$sizeGte`
   - `$sizeLte`
   
   have no precedence in MongoDB which was the original inspiration for the MongoDB language. If I'm reading the MongoDB docs right, the MongoDB way of performing this query would be to allow the following syntax:
   
   ```
   {
     "selector": {
        "customers": {
           "$size:": { "$gte": 20}
         }
      }
   }
   ```
   
   The advantage of this approach is that
   
   a) we already have a `$size` operator.
   b) we have plenty of other comparison operators `$eq`, `$gte` etc etc
   c) it wouldn't be creating new operators that differ from the "MongoDB way"
   
   Note that currently the Mango query parser doesn't support this syntax, but I'm suggesting it could be modified to, rather than adding lots of new `$size...` operators.
   
   
   What do you thinkg @hklarner & @garrensmith?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org