Joseph6975630
Posts: 0
Joined: Wed Jul 09, 2014 1:49 pm

Queries to join one collection to another

For some reason I am struggling with this and have searched for it but cannot find a result. I am sure the answer is relatively simple. I am trying to do a query on data in my database which has a pointer to a diff collection. Here is the raw test JSON data in the db. I am essentially trying to do a query that says, show me a result set that lists where agegender is "Boys". I have tried { "TeamID":{ "Agegender":"Boys"}} but it just brings back a blank result. TeamID is the column in one collection that is populated by a pointer to a different collection.

{
"Day":"Sun",
"Order":4.0,
"TeamID":{
"Agegender":"Boys",
"Agegroup":"U8",
"Coach":{
"Name":"Mahos",
"Order":"2",
"Phone":"1212555",
"createdAt":"2014-07-07 22:59:20.504",
"id":"53bb2648e4b057cdab9ac3fe",
"updatedAt":"2014-07-07 22:59:29.057"
},
"Order":3.0,
"createdAt":"2014-07-07 22:46:03.149",
"id":"53bb232be4b057cdab9ac3fa",
"updatedAt":"2014-07-08 17:57:04.473"
},
"Time":"12:00pm",
"Type":"Game",
"createdAt":"2014-07-04 01:04:56.864",
"id":"53b5fdb8e4b057cdab99aa32",
"_updatedAt":"2014-07-08 17:58:36.067"
},

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Queries to join one collection to another

Hello Joseph,

Please look at this link, it should help:
http://devcenter.appery.io/documentat...

Joseph6975630
Posts: 0
Joined: Wed Jul 09, 2014 1:49 pm

Queries to join one collection to another

Yes I have already tried that. The documentation is clear. The include already exists for the teamID collection but the query { "TeamID":{ "Agegender":"Boys"}} still returns null.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Queries to join one collection to another

Hello!

Please try this query pre{"TeamID":{"$inQuery" :{"Agegender":"Boys"}}}/pre

Joseph6975630
Posts: 0
Joined: Wed Jul 09, 2014 1:49 pm

Queries to join one collection to another

thanks. I just modified the database and added a column so I wouldnt have to the join. This method worked fine. Thank you for the help. I now have a different issue but that is posted as a separate questions.

Return to “Issues”