Currently I use firebase as my database. I need to pick up a collection and bring the data for a specific month according to two fields in my collection. The firebase does not let us make querys with different fields so I have chosen to bring everything from the year 2018 and filter in my array the specific month.
I make the following query in firebase:
let start = new Date('2018-01-01');
let end = new Date('2018-12-31');
let ref = db.collection('eventos').where("dt_inicio", ">", start).where("dt_inicio", "<", end).orderBy("dt_inicio", "asc");
ref.get()
.then(function (querySnapshot) {
querySnapshot.forEach(function (doc) {
console.log(doc.data());
});
});
It returns me to doc.data (), and giving a console.log I have the following return.
I'd like to filter the start date and end date by the month of 08/2018.
How do I proceed?