Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude rows that by filtering out via columns with specific set contents #268

Open
MHOOO opened this issue Dec 24, 2024 · 0 comments
Open

Comments

@MHOOO
Copy link

MHOOO commented Dec 24, 2024

Is there some way to exclude content from a query, for example by writing something similar to this non functional query:

await triplit.fetch(triplit.query('content').where(['tags.name', '!=', 'TagIDoNotWant']).limit(5).build())

given this schema?

{
	tags: {
		schema: S.Schema({
			id: S.Id(),
			name: S.String(),
		})
	},
	content: {
		schema: S.Schema({
			id: S.Id(),
			url: S.String(),
			tags: S.RelationMany('tags', {
				where: [['id', 'in', '$tag_ids']]
			}),
			tag_ids: S.Optional(S.Set(S.String())),
		})
	}
}

I've tried:

  • nin instead of != ⇒ simply appears to ignore the where clause
  • nin with the tag name on the left side of the where clause (i.e. .where(['TagIDoNotWant', 'nin', 'tags.name']) ⇒ exception due to it being an invalid query
  • Manually removing entries after the query. While this works, it requires me to query again & again with growing limits, until I find enough entries to satisfy the actual passed limit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant