Skip to main content

Questions tagged [mongoose]

Mongoose is a MongoDB object modeling tool, or ODM (Object Document Mapper), written in JavaScript and designed to work in an asynchronous environment.

Filter by
Sorted by
Tagged with
0 votes
1 answer
75 views

MongoDB schema: optional vs. nullable

If I have a schema that includes fields that may or may not be set, what is the best way to handle these fields? Should they be optional or instead nullable? Here an example (Mongoose/NestJs) @Schema()...
KorbenDose's user avatar
-2 votes
2 answers
1k views

How to best manage multilingual information in documents in JSON/MongoDB/Mongoose?

I have to manage multilingual information in JSON documents in a MongoDB/Mongoose context. But I'm in a dilemma regarding best the format to use with a view to performance metrics: I'm currently ...
The Neighbors Kid's user avatar
1 vote
0 answers
309 views

Refactor MVC to more scalable architecture?

Months ago I began a new web project which, in the beggining, seemed like a small application with virtually few users. I began the project by using the awesome Hackathon Starter WebApp Boilerplate by ...
HumbertoWoody's user avatar
1 vote
0 answers
37 views

avoid passing dbsession object to multiple modules

I have a project which has a service-oriented architecture. for example, anything relates to payment is inside payment module. -dao -config -constatnts -middlewares -modules -payment -user -...
amir's user avatar
  • 133
1 vote
1 answer
3k views

MongoDB - Do subdocuments count towards the total size of a document

I'm wondering if you had something like a list and a subdocument of items. Does MongoDB save them all as a single document, or does MongoDB regard the subdocuments as independent documents. This is in ...
A. L's user avatar
  • 217
1 vote
1 answer
655 views

Should be using MongoDB lookup or bulk update the data?

I am developing a social network app, we chose MongoDB as the storage for our app and mongoose as an ORM. Everything was going smoothly until one dark day the client said he needs to let the users to ...
Sami's user avatar
  • 111
0 votes
1 answer
303 views

Why does Angular 2 recommend using Services to make HTTP calls

In Angular 2's official tutorial, any operation involving getting or saving a class necessitates using a service. For a Hero class, they had to create a HeroService to perform all HTTP calls. This ...
Zsw's user avatar
  • 163
3 votes
2 answers
2k views

Is it bad practice to generate ids for an object that does not yet exist in the database?

Here is the situation: There is a Mongo database A and there is Mongo database B. There is a business concept/Mongo object that is called someModel which exists on one of database B's collections. ...
AvetisCodes's user avatar
  • 1,534
1 vote
0 answers
78 views

Feedback on simple authorisation system design

I'm writing a fairly simple authentication/authorisation api for an intranet application we are developing. It's my first roles based authorisation system and its a good opportunity for a first ...
hammus's user avatar
  • 121
4 votes
1 answer
812 views

Filtering request and responses in RESTful MEAN stack

I have a very basic RESTful service written using the MEAN stack (MongoDb, Express.js, Angular.js, Node.js) and utilizing the Mongoose ODM. Product schema var productSchema = new mongoose.Schema({ ...
Matthew's user avatar
  • 2,006