Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
1 answer
50 views

const mongoose = require("mongoose"); const passportLocalMongoose = require("passport-local-mongoose"); const userSchema = new mongoose.Schema({ Fullname: { type: ...
Annu Roy's user avatar
2 votes
1 answer
89 views

I'm trying to implement a robust search function in my NestJS/Mongoose application that can handle partial matches while being case-insensitive and diacritics-insensitive (ignoring accents). My ...
Steeven Delucis's user avatar
3 votes
1 answer
63 views

exports.getAllProducts = async (req, res) => { try { console.log(req.query); const queryObj = { ...req.query }; const excludedFilters = ["page", "limit", "...
ahmad fakher's user avatar
0 votes
1 answer
62 views

Take the following Mongoose schema. const userSchema = mongoose.Schema({ username: { type: String, required: true, unique: true, minLength: 3 }, name: ...
Ahmad's user avatar
  • 10
0 votes
0 answers
17 views

//User Schema const userSchema = new mongoose.Schema({ name: String, email: String }); userSchema.virtual('posts', { ref: 'Post', localField: '_id', foreignField: 'author' }); //Controller ...
Dipak Halkude's user avatar
2 votes
1 answer
89 views

I am new to programming (and NextJS) and I'm building a NextJS app, using Mongoose for my MongoDb connection. I was wondering if I should close the connection after each query? Right now I am just ...
Alex's user avatar
  • 13
-1 votes
1 answer
56 views

i have some problems in production using mongo We have python using mongo and mongo-express for ui. And we are facing performance issues, after research i found db.currentOp() to see queries which are ...
Zesshi's user avatar
  • 522
0 votes
0 answers
23 views

I have these two schemas with discriminator. It's custom activity that also has fill in the gaps questions which is another schema. For some reason when I use findByIdAndUpdate, it updates all the ...
FouLiNuX's user avatar
0 votes
1 answer
67 views

I am trying to solve an issue with the format of documents in a MongoDB depicted below. { "_id": { "$oid": "68dc4f78e11553b3647231e2" }, "name": "...
Cade Bray's user avatar
  • 101
0 votes
1 answer
43 views

While defining the model, discriminators are created on the basis of the SchemaVersion. On export, the already created discriminator model is returned to prevent the overwrite errors from mongoose ...
nischalmainali21's user avatar
0 votes
1 answer
55 views

When I execute the following code in my application: const freelancer = await Freelancer.findOne( { _id, 'experiences.title': 'Frontend Javascript developer' }, { 'experiences.$': 1 } ); console....
Raphael's user avatar
  • 767
0 votes
0 answers
70 views

I am working on migrating the project to a new version. Stack: express 5, mongoose 8, typescript 5.8, typegoose 12 I looked for more information and would now like to clarify the cause of the problem:...
Roman Nozhenko's user avatar
0 votes
0 answers
72 views

Hopefully this makes sense. Using mongoose to push new items into an array of subdocuments, the documents get added fine, however on certain (random) occasions, the createdAt date of the current ...
Stephen Clark's user avatar
2 votes
1 answer
103 views

I would like to know how to use @Virtual from nestjs/mongoose to calculate a local field with fields from another schema (like a classic mongoose populate)? I have this InvoiceHub schema that ...
Steeven Delucis's user avatar
0 votes
1 answer
52 views

I have a mongoose schema where I defined a text index like this: FreelancerSchema.index({ title: 'text', presentationText: 'text' }, { weights: { title: 2, presentationText: 1 } }); I try to search ...
Raphael's user avatar
  • 767

15 30 50 per page
1
2 3 4 5
3111