Matt Luo
Matt Luo5mo ago

Database filter operator, contains

Does Convex dashboard have a database column filter operator, contains?
7 Replies
Matt Luo
Matt LuoOP5mo ago
No description
v
v5mo ago
it looks like the jwt data in the socket passes the type of comparison. the jwt is
{
"clauses": [
{
"op": "neq",
"id": "0.8618394424980738",
"field": "_id",
"value": ""
}
],
"alg": "HS256"
}
{
"clauses": [
{
"op": "neq",
"id": "0.8618394424980738",
"field": "_id",
"value": ""
}
],
"alg": "HS256"
}
so i think the op would be one of the six Comparisons
Matt Luo
Matt LuoOP5mo ago
So, i guess, there is no operator for contains or includes?
v
v5mo ago
you can do this tho
export default query(async (ctx) =>
(await ctx.db.query("messages").collect())
.filter(m => m.content.includes('hey'))
)
export default query(async (ctx) =>
(await ctx.db.query("messages").collect())
.filter(m => m.content.includes('hey'))
)
seems not
ian
ian5mo ago
You can do this with separate point lookups in parallel. see https://discord.com/channels/1019350475847499849/1266488659041849374 In the dashboard you can do this in a Custom Query (in code), which now has function running history so hopefully is easier to not have to copy it out for future use
Matt Luo
Matt LuoOP5mo ago
Ah okay, the function history is good enough. Thank you. I will remove the feature request tag