Closed Nelly-Barret closed 1 week ago
This is fixed now:
[
{
_id: ObjectId('6672954796d8fcc09725ac8d'),
identifier: { value: 'Sample/20LD811194' },
BIS: 0,
createdAt: ISODate('2024-06-19T10:22:31.000Z'),
resourceType: 'Sample',
sampling: 'Iniziale',
timeCollected: ISODate('2021-12-16T00:00:00.000Z'),
timeReceived: ISODate('2021-12-16T00:00:00.000Z'),
tooYoung: 0
}
]
does not show the NaN
quality field anymore.
A good test is to look for any field having a NaN value
We can show instances with at least one NaN value with this query:
db["Sample"].aggregate([{$addFields: { doc: { $objectToArray: "$$ROOT" }}}, { $match: { "doc.k": /.*/i, "doc.v": NaN}}])
"doc.k": /.*/i
matches any field in the instance
The above query returns nothing if no instance has a NaN value (in any field). This is now the case for the Sample table.
Merged with https://github.com/Nelly-Barret/BETTER-fairificator/pull/64
Taking advantage of the MongoDB flexible architecture, when there is no value for a specific column (typically a NaN / empty cell), we should not record NaN or "" or null for that column.
However, I could see some columns with NaN value in the Sample instances: