I am trying to create a simple nestjs project that connects to mongodb. I followed the official documentation of nestjs, but connected to my own db with "user"
I was looking around in Discord.JS and creating a bot, but every time I want to turn on the bot, ( using node index.js) this error happens: throw new Error("Th
I'm trying to find the id of an object inside an array of objects. That _id has the same field name _id as others in the document. This is my model (brief) var
The above query returns a 200 when I try to create a User, but whenever I log into MongoDB there is no collections created. Can anyone help ? //user model co
I have a Mongo collection like this: { "user_id" : "1", "branch_id" : "1", "trans_type":"DEBIT", "total" : 500 }, { "user_id" : "1", "b
I'm looking for a way to refactor part of my code to be shorter and simpler, but I don't know Mongoose very well and I'm not sure how to proceed. I am trying t
Basically I have a mongodb collection called 'people' whose schema is as follows: people: { name: String, friends: [{firstName: String, lastN
I just noticed that when i update my schema definition and add a field, for instance "name: String" and then try to use People.update( { _id: user_id }, { $se
I am using schema.pre('save', function (next) { if (this.isModified('field')) { //do something } }); but I now need to use this same function isModi
I'm building a Mongoose schema for a dating app. I want each person document to contain a reference to all the events they've been to, where events is another
Is it possible to have nested schemas in mongoose and have a required validator on the children? Something like this: const userSchema = new mongoose.Schema({
The number is larger than 9223372036854775807 - too big for NumberLong, which is mongo's native 64-bit long type. What's the best way to do this/the best field
I'm creating a testing for my express app. The project has multiple test files. In each module the server instance is required at beforeEach() method and closed
The documentation here doesn't provide much of an explanation for why there are two different operations to accomplish the same thing, so I'm wondering what the
Suppose the mongodb document(table) 'users' is { "_id": "6065923bc5d509071857f6e6", "version": [ { "name": "1.1.0",
When I run the send route I have error: MongoError: Cannot call abortTransaction twice and MongoError: Cannot call abortTransaction after calling commitTransact
const serverS = await server.findOne({ guildID: message.guild.id }); serverS.settings[1]["links"] = true; serverS.save() The code I use ^^^^ So when it saves t
Discord.js 13.6.0 | Node.js 16.14.2 | Mongoose 6.2.3 I want to do so that my bot searches the database to see if the guild should be removed or added Example I
I have document containing lists. Lets say they are: [ { _id: 52b37432b2395e1807000008, name: ListA, order: 1, desc: 'More about List A' }, { _id:
I'm trying to switch to mongoose from using just the native mongodb and having some trouble. Connecting to the db as I did previously works fine: var db; var