-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API EndPoint for BAN Address scoring #323
base: master
Are you sure you want to change the base?
Conversation
// Score-5: Nombre de documents 'Adresse' avec source 'bal', certificationCommune à true, parcelles non vides et banId non null | ||
const score5 = await adresseCollection.countDocuments({ | ||
sources: 'bal', | ||
certificationCommune: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Le champ certificationCommune
n'existe pas sur l'adresse. Il s'agit du champ certifie
, certificationCommune
étant un champ d'adressesOriginales
, le champ qui permet de garder la source originale de l'adresse.
const score4 = await adresseCollection.countDocuments({ | ||
sources: 'bal', | ||
$or: [ | ||
{certificationCommune: true}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem pour certificationCommune
{parcelles: {$not: {$size: 0}}, banId: {$ne: null}}, | ||
], | ||
$nor: [ | ||
{certificationCommune: true, parcelles: {$not: {$size: 0}}, banId: {$ne: null}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem pour certificationCommune
// Score-3: Nombre de documents 'Adresse' avec source 'bal', certificationCommune à false, parcelles vides et banId non null | ||
const score3 = await adresseCollection.countDocuments({ | ||
sources: 'bal', | ||
certificationCommune: {$ne: true}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem pour certificationCommune
const score3Legacy = await adresseCollection.countDocuments({ | ||
sources: 'bal', | ||
$or: [ | ||
{certificationCommune: true}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem pour certificationCommune
|
||
// Score-3: Nombre de documents 'Adresse' avec source 'bal', certificationCommune à false, parcelles vides et banId non null | ||
const score3 = await adresseCollection.countDocuments({ | ||
sources: 'bal', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem pour le champ sources
|
||
// Score-3-Legacy: Nombre de documents 'Adresse' avec source 'bal', certificationCommune à true ou parcelles non vides et banId à null (mais pas les deux à la fois) | ||
const score3Legacy = await adresseCollection.countDocuments({ | ||
sources: 'bal', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem pour le champ sources
|
||
// Score-2: Nombre de documents 'Adresse' avec source 'bal', certificationCommune à false, parcelles vides et banId à null | ||
const score2 = await adresseCollection.countDocuments({ | ||
sources: 'bal', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem pour le champ sources
}) | ||
|
||
// Score-1: Nombre de documents 'Adresse' avec source 'Guichet Adresse' et 'certifie' à true | ||
const score1 = await adresseCollection.countDocuments({sources: guichetAddr, certifie: true}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem pour le champ sources
const totalDocuments = await adresseCollection.countDocuments() | ||
|
||
// Nb-bal: Nombre de documents 'Adresse' avec source 'bal' | ||
const nbBal = await adresseCollection.countDocuments({sources: 'bal'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sur l'adresse, le champ sources
est un array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normalement, quand on test sur une unique valeur, il me semble que cette syntaxe est OK ?
(Mais on peut effectivement utiliser {sources: {$all: ['bal']}}
pour être plus explicite ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est bien de l'avoir en tète. Mais pas un souci sur une condition égalité /in simple (et pour les sources bal normalement il est seul)
const toPercent = (value, total) => Math.round((value / total) * 100) | ||
|
||
async function getStatistics() { | ||
const guichetAddr = 'ign-api-gestion-ign' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sur l'explorer le guichet adresse est sourcé avec
const guichetAddr = 'ign-api-gestion-ign' | |
const guichetAddr = 'ign-api-gestion-municipal_administration' |
const totalDocuments = await adresseCollection.countDocuments() | ||
|
||
// Nb-bal: Nombre de documents 'Adresse' avec source 'bal' | ||
const nbBal = await adresseCollection.countDocuments({sources: 'bal'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est bien de l'avoir en tète. Mais pas un souci sur une condition égalité /in simple (et pour les sources bal normalement il est seul)
Passage en Draft : Test d'une autre approche basé sur la base de donnée (vue et calcule direct sur la base) |
No description provided.