MongoDB-PHP: JOIN-like query

Posted by mdm414 on Stack Overflow See other posts from Stack Overflow or by mdm414
Published on 2010-04-20T10:42:43Z Indexed on 2010/04/20 22:33 UTC
Read the original article Hit count: 409

Filed under:
|

Here are the objects:

courses
{ "name" : "Biology", "_id" : ObjectId("4b0552b0f0da7d1eb6f126a1") }
students
{
        "name" : "Joe",
        "classes" : [
                {
                        "$ref" : "courses",
                        "$id" : ObjectId("4b0552b0f0da7d1eb6f126a1")
                }
        ],
        "_id" : ObjectId("4b0552e4f0da7d1eb6f126a2")
}

Using the PHP Mongo Class, how do I get all the students that has a biology course?

Thanks

© Stack Overflow or respective owner

Related posts about mongodb

Related posts about php