I have a collection in MongoDB that represents the chores kids needs to do each day and whether they are done. Here is an example of a document.
{
"_id":"2022-02-13:joe",
"kidName":"Joe",
"chores": [
{"chore":"Breakfast: clear dishes and utensils","done":true},
{"chore":"Clearing dishes after meals","done":true},
{"chore":"Put away coats, knapsack, and shoes","done":true},
{"chore":"Clear toys","done":true}
],
"date": 2022-02-13T00:00:00.000+00:00
}
I want to change it so that, instead of a Boolean, done
is an integer, where:
Meaning | value |
---|---|
Done | 1 |
Not Done | -1 |
Unmarked | 0 |
Is there a pipeline or trick in Compass to do this for all documents in the collection?