October 31, 2020

Category: aggregation

How to use MongoDB date aggregation operators in Node.js with Mongoose ($dayOfMonth, $dayOfYear, $dayOfWeek, etc)
$dayofmonth in mongodb, aggregation, Any, date, date operator, day, dayOfMonth, dayOfWeek, dayOfYear, Development, hour, Javascript, millisecond, minute, MongoDB, Mongoose, month, node, node.js, schema, seconds, Tutorials, week, year

How to use MongoDB date aggregation operators in Node.js with Mongoose ($dayOfMonth, $dayOfYear, $dayOfWeek, etc)

While I was working on creating a tutorial for MongoDB aggregation I came across a few issues while trying to use the built in date aggregation operators.  I was storing the date in the db as the unix epoch timestamp.  I tried multiple variations such as “new Date()”, “new Date().getTime()”, “Date.now()”, etc, but none of […]

Read More
How to count the number of values found for a field in MongoDB using Node.js and Mongoose (using aggregation)
1154, 1188, aggregation, Any, count, Development, Javascript, js, MongoDB, mongodb aggregation node.js, Mongoose, mongoose sum, node, node.js, nosql, sum

How to count the number of values found for a field in MongoDB using Node.js and Mongoose (using aggregation)

This post is part 1 of a series of posts I will make regarding Node.js and MongoDB.  I will be using the Mongoose module for Node.js, but for the most part the MongoDB syntax is about the same.  The ultimate goal with this series is to take data from a MongoDB database, and use that […]

Read More