Skip to content

Instantly share code, notes, and snippets.

View emonhossainraihan's full-sized avatar
🎯
Focusing on topology

EmonHR emonhossainraihan

🎯
Focusing on topology
View GitHub Profile

Implementing a cacheing layer in NodeJS and MongoDB using Redis

Three ways to trigger a query to be sent off to MongoDB

// executing callback
const query = model.find({});
query.exec((err, result) => console.log(result));

// using promise-based