I have some steps saved in RethinkDB like this :
{
date: "Sat Feb 06 2015 00:00:00 GMT+00:00",
step: 1
},
{
date: "Sat Feb 06 2015 11:11:11 GMT+00:00",
step: 3
},
{
date: "Sat Feb 06 2015 22:22:22 GMT+00:00",
step: 2
}
I'd like to count the number of steps done in order 1, 2, 3.
So for this example, I'd like to get something like this :
{
step_1: 1,
step_2: 1,
step_3: 0
}
I have seen a step 1, so step_1 is 1
I have seen a step 2, and have seen a step 1 before, so step_2 is 1
I have seen a step 3, but I haven't seen a step 2 before, so step_3 is 0
I've tried a lot of things but didn't find a way to do it and actually I'm not really sure it's possible with RethinkDB.
Any of you have an idea for me ?
Thanks,
Adrien