You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do I perform a query with the library where I need to select the last records recorded and grouped by an element.
the colection name is ExampleCol and the elements _id, Hexample, Hdate
In MYSQL i do this ( SELECT * FROM TABLE WHERE CONDS GROUP BY COLUMN NAME)
In MONGO DB I had a success using this code.
How do I perform a query with the library where I need to select the last records recorded and grouped by an element.
the colection name is ExampleCol and the elements _id, Hexample, Hdate
In MYSQL i do this ( SELECT * FROM TABLE WHERE CONDS GROUP BY COLUMN NAME)
In MONGO DB I had a success using this code.
db.ExampleCol.aggregate(
[
{ $sort: { HDate: -1, Hexample: -1 } },
{
$group:
{
_id: "$_Hexample",
"_Hexample": {"$last":"$_Hexample"},
lastHDate: { $last: "$HDate" }
}
}
]
)
How to Mount a query using ur library?
I tried....
$this->mongo_db->aggregate(); -not success;
$this->mongo_db->command(); -not success;
The text was updated successfully, but these errors were encountered: