Questions tagged [monk]

Monk is a compact module designed to enhance the user experience when working with MongoDB in Node.JS.

What is the best way to access a database connection throughout an entire node.js application?

In my application's app.js file, I establish a connection to mongodb using the monk module. var express = require('express'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var mong ...

Upon initializing Gridfs, a TypeError is encountered indicating that a string is not a function

My goal is to store an uploaded file, like an image, in a mongodb database. However, I keep encountering a Type Error when trying to set up the gridfs-stream. Below is my code snippet: var mongo = require('mongodb'); router.post('/createpost', cpUpload, ...

Challenge in resolving a promise returned by the find() function in mongodb/monk

I've encountered an issue where the simple mongodb/monk find() method isn't working for me. I am aware that find() returns a promise and none of the three ways to resolve it seem to be successful. Can someone point out what mistake I might be making? Thank ...

Extremely sluggish updating efficiency

As I parse through a CSV file, I aim to verify if the corresponding entry exists in the database for each row. If it does exist, I want to update it; if it doesn't, I want to create a new entry. The process seems to be sluggish, averaging only around ...