Page 1 of 1

How can I construct Query joins?

Posted: Mon Sep 10, 2012 6:14 am
by John Thomas

I would like the user to see a list of other users they are connected with. To do this I created a Friends collection that maps the objectids from Users as userId and friendId. How do I display the names of each friend instead of the objectId? In other words, how do I do a query that joins two collections? I'm used to T-SQL where this is simply done. I'd hate to have to go back and hit the server one friend at a time to retrieve each name, when I really want something like this:

SELECT _objectId, name
FROM Users
WHERE _objectId IN
(SELECT _friendId FROM Friends WHERE userId = @myObjectId)
ORDER BY name


How can I construct Query joins?

Posted: Mon Sep 10, 2012 2:34 pm
by Maryna Brodina

Hello! There is no option to do it on server side yet. You can get Friends and Users collections and match them using JS.


How can I construct Query joins?

Posted: Fri Oct 26, 2012 4:17 pm
by RichardGolko

Gosh this is a pretty basic requirement for databases! Hope something come along quick!