7
DBX12
4y

What is the purpose of using MongoDB and then adding mongoose?
If you want schemas, relations and all the jazz mongoose offers, have you considered using a RDBMS instead of a datapile system? Most (probably all) SQL databases support schemas, relations and all the jazz you seem to need.

So, ask yourself: Do you really need the functionality of a NoSQL database or do you just want it because it's shiny and new and "everybody uses it (tm)"?

Comments
  • 0
    Because it was shiny and new a few years ago so we're cursed to use it at work for no fucking reason.
  • 0
    We can use JS objects for/with other ORMs too? (Asking because I used Mongoose too. Just because.)
  • 0
  • 2
    @Cyanide Yes.

    Example : We use MS SQL.
    We have a table of user preferences.
    There is 2 fields :
    1. Id (PK) of user
    2. nvarchar(max) containing JSON object

    Now sometimes we need to filter on some preferences.

    We have a view which presents selected JSON properties as normal database columns and it's pretty fast.

    You can look into OPENJSON and JSON_QUERY.

    Don't know for other databases tho

    Edit : Oh sorry I missunderstood the quetion. Well, i keep this comment anyway.
Add Comment