I want to perform a query like that:
SELECT Conversation.objectId, Conversation.name, LastMessage.seen
FROM Conversation
INNER JOIN LastMessage ON Conversation.last = LastMessage.objectId; WHERE LastMessage.seen LIKE “${my id}”
Would any one can help me to translate it into Backendless data query for flutter?
Many thanks,
@mark-piller
The “Conversation” table store all the conversations between 2 or many users.
The “LastMessage” table store the last message sent in a conversation.
Why do I need the “LastMessage”? Because that table has “Seen” property where I can use to track if the last message has been seen by all users or not in a conversation.
My asked query is to display all the “seen” messages.
@Volodymyr_Ialovyi Sorry but it’s still not working
I tried to rewrite your query in flutter:
DataQueryBuilder q = DataQueryBuilder()
…whereClause = “users.objectId= ‘${AppPref.user.objectId}’ or users.objectId = ‘$uid’”
…properties = [‘name’]
… properties = [‘Count(users) as count’]
…groupBy = [‘users’]
…havingClause = ‘count=2’;
The where clause that Vladimir suggested is below, but in your message after you used something completely different. Are you staying on the same topic?