Skip to content
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

Change certaintyScore to score and manage annotation source #168

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

ajeanneney
Copy link
Collaborator

@ajeanneney ajeanneney commented Mar 4, 2025

Au moment de la mise en production il faut prévoir de changer les certaintyScore en score dans la collection treatments de la base de donnée.

linked with Cour-de-cassation/dbsder-api#155

@ajeanneney
Copy link
Collaborator Author

ajeanneney commented Mar 7, 2025

Requete permettant de changer certaintyScore en score

db.treatments.updateMany(
  {},
  [
    {
      $set: {
        "annotationsDiff.before": {
          $map: {
            input: "$annotationsDiff.before",
            as: "annotation",
            in: {
              $mergeObjects: [
                "$$annotation",
                { "score": "$$annotation.certaintyScore" }
              ]
            }
          }
        },
        "annotationsDiff.after": {
          $map: {
            input: "$annotationsDiff.after",
            as: "annotation",
            in: {
              $mergeObjects: [
                "$$annotation",
                { "score": "$$annotation.certaintyScore" }
              ]
            }
          }
        }
      }
    },
    {
      $unset: [
        "annotationsDiff.before.certaintyScore",
        "annotationsDiff.after.certaintyScore"
      ]
    }
  ]
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants