V
V
Vladimir2017-03-25 18:55:53
JavaScript
Vladimir, 2017-03-25 18:55:53

How to describe Schema in mongoDB?

Good afternoon, tell me how best to store data in mongoDB. There is registration on the site, after authorization, the user can add tasks, 9ed1feeaee07458e9ab75f4bdee0e7e5.png
... ed63edc632924164833784565f4da6b1.pngThe essence of the question is how best to describe the scheme, create 2 tables or can it be stored in one? Thought to describe the scheme something like this

var project = new Schema({
    head:{
        head_task: String,
        userID: String
    },
    task: {
        context_task: String
    }
});
or for subtasks/items to make a separate table?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dummyman, 2017-03-26
@zhuravlev125

In general, each enumerated type can be created according to a schema. But it is not necessary to use a database for your needs. What didn’t suit you, which is already a standard storage format https://taskwarrior.org/ ? Locally, it can be stored in a text editor, and they already have their own server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question