mongoose Questions

2

Solved

In our codebase we've been using T.lean() or T.toObject() and our return types would be LeanDocument<T>. Mongoose 7 no longer exports LeanDocument, and the existing migration guide suggests u...

6

There are a lot of errors in my application console. How to fix it? Next js 13.2 / app directory Import trace for requested module: ./node_modules/@aws-sdk/util-user-agent-node/dist-cjs/is-crt-avai...
Scissure asked 27/2, 2023 at 4:51

3

Solved

My schema is as follows : - var Schema1 = new mongoose.Schema({ name: String, description: String, version: [{ id: String, status: Number }] }); I want to unset the version field. I try th...
Scaffolding asked 28/5, 2014 at 10:30

4

Solved

const generatedEvent = await Event.create(req.body); res.send(generatedEvent); I am getting some data from the request body and I can generate a new Event. And I'm returning the event to client...
Mamoun asked 8/6, 2020 at 7:30

15

Solved

I'm learning Node.js and just started working with MongoDB. I'm making a connection with the MongoDB Cluster I've created const dbURI = 'mongodb+srv://testuser:[email protected]/mydb?retryWrit...
Assassinate asked 8/1, 2021 at 4:19

14

Solved

A bunch of similar questions answered before but none of them seem to fix my problem. No problem in adding the first user. However, the username doesn't display the records and gives error on addin...
Byway asked 10/9, 2020 at 11:0

2

How can I pass a session variable to Model.Create() in mongoose. I have tried some code but it gives me the following error: "to pass a session to Model.create() in Mongoose, you must pass an arra...
Furry asked 30/10, 2019 at 7:6

1

Solved

I'm getting the following random message on my Mongo Atlas "Access History" view: "FAILED BadValue: SCRAM-SHA-256 authentication is disabled" This message is attached to my appl...
Fulsome asked 28/9, 2022 at 1:1

6

I'm trying to hash passwords in an app I'm building and they are hashing fine when I create a user by calling this function(coffeesctipt): UserSchema.pre 'save', (next) -> user = this hashPass...
Retarder asked 20/10, 2016 at 18:3

3

I am creating passport authentication for node using mongoose. I don't have any collection called "users" in my database. But while creating new user using the schema like below var mongoose = req...
Jerricajerrie asked 20/8, 2014 at 12:53

5

I'm building a Next.js application with TypeScript and MongoDB/Mongoose. I started running into an error when using Mongoose models, which was causing them to attempt an overwrite of the Model ever...
Snapshot asked 25/1, 2021 at 15:7

6

Solved

I am trying to download mongoose into my node.js project via npm. The command is npm install mongoose. However, this leads to the below output, and eventually leads to an error. The only things i...
Lalitta asked 3/10, 2013 at 4:43

3

I made an review app with Express and Mongoose. I have an review model like below: var mongoose = require('mongoose'); var ReviewSchema = mongoose.Schema({ title: String, description: String, ...
Bottommost asked 25/8, 2018 at 5:56

7

Solved

I want to show products by ids (56e641d4864e5b780bb992c6 and 56e65504a323ee0812e511f2) and show price after subtracted by discount if available. I can count the final price using aggregate, but th...
Riobard asked 24/3, 2016 at 4:27

4

Solved

I'm trying to set up notifications for an Express app using MongoDB. I have an API endpoint where I $push a user's id to the readBy field in MongoDB to "mark" it as read after retrieving ...
Natividad asked 1/12, 2021 at 22:43

3

Solved

I've got a schema that looks a bit like: var conversationSchema = new Schema({ created: { type: Date, default: Date.now }, updated: { type: Date, default: Date.now }, recipients: { type: [Schem...
Corrincorrina asked 12/5, 2012 at 23:46

5

Recently I updated Node.js to version 20.3.1 and tried to connect my MongoDB Atlas. When my Node.js's version is 19.X, the connection of Atlas is normal. However, The terminal shows the deprecation...
Mcelroy asked 1/7, 2023 at 11:46

7

Context: I have a Post Mongoose model that contains a csv_files array field to store csv strings. I make a fetch API request from a different web app to POST the csv strings for a particular Post. ...
Michaud asked 20/7, 2017 at 18:51

27

How to solve model.find() function produces "buffering timed out after ... ms"? I'm using mongoose v 5.11.0, npm v6.14.8 and mongodb v Here's the code. var express = require('express'); v...
Hutton asked 1/12, 2020 at 12:24

6

vs code terminal showing deprecation warning (node:22063) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ....
Countryandwestern asked 1/12, 2023 at 18:22

5

Hello my problem is I want to use the search query of mongoose. But I want to make a get request using a query. Why is that not possible? I do not understand this error. I am using version 5.10.0 o...
Compel asked 25/8, 2020 at 13:24

5

Solved

I want to create an activity model in order to show a timeline kind of thing with my application, but I don't know exactly how to dynamically reference a collection in a mongoose schema. Im using m...
Sanford asked 28/10, 2013 at 23:31

3

Solved

So, i'm trying to delete a document when a button is pressed. The button code looks like this: <form action="/patients/delete?_method=DELETE" method="POST"> <input typ...
Oviduct asked 30/7, 2020 at 15:27

30

I am trying to create a fullstack app reading the following tutorial: https://medium.com/javascript-in-plain-english/full-stack-mongodb-react-node-js-express-js-in-one-simple-app-6cc8ed6de274 I f...
Dissimulate asked 3/12, 2019 at 17:22

11

Solved

I have a problem with Mongoose and MongoDb It is very interesting that only Model.update works and save never works and does not even fire callback. Mongoose: 4.4.5 MongoDB: 3.0.8 Express Route ...
Footer asked 1/3, 2016 at 21:14

© 2022 - 2024 — McMap. All rights reserved.