fudon
11/29/2025, 4:46 AM! in the query filtering is not working as I expected, and "filter_by" : "!$blocks(blocker_user_id := 1)" and "filter_by" : "$blocks(blocker_user_id := 1)" returns the seame result. Can anyone let me know how to solve this?
I’m using version 29.0
blocks_schema = {
'name': 'blocks',
'fields': [
{'name': 'id', 'type': 'string'},
{'name': 'blocker_user_id', 'type': 'int32'},
{'name': 'blockee_user_id', 'type': 'int32'},
],
}
posts_schema = {
'name': 'posts',
'fields': [
{'name': 'id', 'type': 'string'},
{'name': 'name', 'type': 'string', "stem": true},
{'name': 'description', 'type': 'string'},
{'name':'created_at', 'type': 'int64'},
{'name':'created_by', 'type': 'int32', "reference": "blocks.blockee_user_id", "async_reference": true},
],
}Jonathan King
12/03/2025, 7:25 PMblockee_user_id isn't a unique field. What you'd want to do is make a users collection that has a one to many relationship to posts, and also a one to many relationship to blocks. Then you can nest the filter logic in the user->blocks relationship like so: "filter_by" : "$users(!$blocks(blocker_user_id:=1))". I've put up a gist example of how it could work for your example here: https://gist.github.com/YonoYing/73f0de96c0b307e10e33b1a22c4d9deafudon
12/04/2025, 11:44 AM