My array consists of objects structured like this:
{
__v: 0,
_id: "5835ced6ffb2476119a597b9",
castvote: 1,
time: "2016-11-23T17:16:06.676Z",
userid: "57e0fa234f243f0710043f8f"
}
I am looking to create new arrays that filter these objects based on the castvote
values - one for objects where castvote
is set as 1, and another for those with a castvote
value of 2.