Object as terms instead of scalar(s)?

So as for now, we have to remember order of terms in index to pass to match function.

We can use index name itself as a hint but is there big obstacle to make terms object based?
Like instead of

   Match(....,[
         Ref(Collection("users"), "269227053470974471"),
         Ref(Collection("users"), "269239006239130119")
        ]
     )

have a

   Match(....,{
         author: Ref(Collection("users"), "269227053470974471"),
         commenter: Ref(Collection("users"), "269239006239130119")
        }
     )

Hi @ambrt
so far Match() accept an array of values. You can workaround that way:

Let(
    {
        author: Ref(Collection("users"), "269227053470974471"),
        commenter: Ref(Collection("users"), "269239006239130119")
    },
    Paginate(Match(.......,[Var('author'),Var('commenter')]))
)

but not sure this is useful somehow.

Luigi

Hi @ambrt,

Thanks for your feedback! I filed an internal ticket for your Feature Request and I’ll keep you posted on future development around it.
In the meantime I hope the workaround might be useful.

Luigi

2 Likes

Work around is more readable. And thanks for filing a ticket, i’ll be looking forward for it.