Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

142
Visualizações
Nodejs app with mongo database tables schema

I have a question that decide my big project. I want to do a big project API where people can login with Google, send the token and when logged in do some actions saved to Mongo DB.

The problem is the tables structure, or schema. So, I want to do a good app scalable.

I have some tables like Users (with users loggin information) and I want user save his tasks, memories, works and more for him self, and when logged in in another device, get this information and modify.

The question:

I need to do every table for every user or use same table filtered by user?

For example, I have now this model for product:

    nameOfProduct: {
        type: String,
        require: [ true, 'Required name' ],
        unique: true
    },
    state: {
        type: Boolean,
        default: true,
        required: true
    },
    userOwner: {
        type: Schema.Types.ObjectId,
        ref: 'Usuario',
        required: true
    },
    priece: {
        type: Number,
        default: 0
    },
    category: {
        type: Schema.Types.ObjectId,
        ref: 'Category',
        required: true
    },
    description: {
        type: String
    },
    disponibility: {
        type: Boolean,
        default: true
    },
    img: {
        type: String
    },
});

Is this correct or this is not scalabe and I need to do all tables for every user?

Thanks in advanced and sorry for my english, It's hard to write when I'm not english native language (help or correct me if necessary).

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda