Anna-Team / AnnaDB

Developer-first database
Apache License 2.0
56 stars 4 forks source link

Feature Request: Support `in` operator syntax #8

Open amaster507 opened 1 year ago

amaster507 commented 1 year ago

Feature Request

What you wanted to do

Find multiple objects by matching a set of strings

collection|user|:q[
  find[
    in{
      value|username|: m[
        s|foo|,
        s|bar|
      ]
    }
  ]
];

What you did instead

Repeated the path multiple times inside of an or map

collection|user|:q[
  find[
    or[
      eq{
        value|username|:s|foo|
      },
      eq{
        value|username|:s|bar|
      }
    ]
  ]
]

Why that was not good

For the obvious reason, less code is always better when it can do the same thing.

roman-right commented 1 year ago

Makes sense. Thank you. I plan to add a bunch of vector operations for find and update queries. Like in, size, push, etc. I probably will add projections first and these operations right after.

amaster507 commented 1 year ago

Where/when is a good place/time to just chat about tyson with you?

roman-right commented 1 year ago

You can find me on the Discord server: https://discord.gg/s5TUAHkqv7 Or, for a chat, it will probably be better to have a call in any service like zoom or hangouts.

Today is a bit late here (I live in Germany). We can talk tomorrow or at the weekend if this is ok.