Data type issue in aggregation in mongo db

88 views Asked by At

I have written following code for aggregation of two tables in php application

    $lookupTwo = array(
        '$lookup'=> array(
            "from" => "studentTbl",
            "localField" => "studentDetailId",
            "foreignField" => "studentId",
            "as" => "recieverDetails"
        )
    );

Now I am facing an issue, the studentDetailId field is stored as a string and studentId is stored as an integer.

The above query will return empty result.

  • Is there any possibility for performing aggregation in such case?
0

There are 0 answers