Skip to content

Commit

Permalink
change api
Browse files Browse the repository at this point in the history
  • Loading branch information
folland87 committed Jan 30, 2025
1 parent faf86aa commit 51efd02
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/api/commons/queries/sirene-updates.query.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export default [
{
$group: {
_id: "$paysage",
siren: { $first: "$siren" },
siret: { $first: "$siret" },
id: { $first: "$paysage" },
type: { $first: "$type" },
lastModificationDate: { $max: "$lastChecked" },
updates: { $push: "$$ROOT" },
}
},
Expand All @@ -42,6 +47,11 @@ export default [
$project: {
_id: 0,
id: "$_id",
siren: 1,
siret: 1,
id: 1,
type: 1,
lastModificationDate: { $max: "$lastChecked" },
paysageData: { $arrayElemAt: ["$paysageData", 0] },
updates: 1,
}
Expand Down

0 comments on commit 51efd02

Please sign in to comment.