Hello! I'm trying to generate a vector with only one "result". Basically I make a query in the mongo that returns me all the consultations done.
I want to generate an array containing only the completed queries, which in the database are stored as status = 'F'. I'll use this array to generate a graph.
In my view I opened a script tag and put the following:
var teste = [];
teste.filter(function (){
if(status == 'F'){
}
});
And that's where my question comes from, in that function () do I have to pass an object? (In case this object would be the mongo's collection or something I imagine). And if the status is F, I add in the array, if not, not.
Is it more or less how does the filter work or am I wrong?